update pull request with sql in simple quotes

This commit is contained in:
lmarcouiller 2021-01-18 17:05:15 +01:00
parent 841736df87
commit 7c7f80fb59

View File

@ -1417,13 +1417,15 @@ class User extends CommonObject
// Create user and set $this->id. Trigger is disabled because executed later.
$result = $this->create($user, 1);
if ($result > 0) {
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql .= " SET fk_socpeople=".$contact->id;
$sql .= ", civility=\"".$contact->civility_code."\"";
$sql = 'UPDATE '.MAIN_DB_PREFIX.'user';
$sql .= ' SET fk_socpeople='.$contact->id;
$sql .= ', civility="'.$contact->civility_code.'"';
if ($contact->socid) {
$sql .= ", fk_soc=".$contact->socid;
$sql .= ', fk_soc='.$contact->socid;
}
$sql .= " WHERE rowid=".$this->id;
$sql .= ' WHERE rowid='.$this->id;
print var_dump($sql);
$resql = $this->db->query($sql);
dol_syslog(get_class($this)."::create_from_contact", LOG_DEBUG);