Bonsoir,
je souaiterai créer une société dans dolibar à partir du framwork codeigniter
voici la fonction
function createSociete($name,$firstname,$lastname,$civility_id,$address,$zip,$town,$country_id,$phone,$email) {
include_once($this->_path.'/master.inc.php');
$user->fetch("admin");
include_once($this->_path.'/societe/class/societe.class.php');
//var_dump($db);
$company = new Societe($db);
$company->name=$name;
$company->firstname=$firstname;
$company->lastname=$lastname;
$company->civility_id=$civility_id;
$company->address=$address;
$company->zip=$zip;
$company->country_id=$country_id;
$company->phone=$phone;
$company->email=$email;
$company->client=1;
$id=$company->create($user);
return $id;
}
mais lorsque j’execute ce code j’ai une erreur
[code]
DolibarrHasDetectedError.
InformationToHelpDiagnose:
Date: 20140319191656
Dolibarr: 3.5.1
PHP: 5.4.26
Server: Apache/2.2.3 (CentOS)
RequestedUrl: /order/inscription/validation/ZDtkqMKLHWejaIiS3hnf
Referer:
MenuManager:
DatabaseTypeManager: mysqli
RequestLastAccessInError: SELECT rowid,name,label,type,size,elementtype,fieldunique,fieldrequired,param,pos FROM llx_extrafields WHERE entity IN (0,) AND elementtype = ‘user’ ORDER BY pos
ReturnCodeLastAccessInError: DB_ERROR_SYNTAX
InformationLastAccessInError: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND elementtype = ‘user’ ORDER BY pos’ at line 1[/code]
Auriez vous une idée ?
par avance merci