Postgresql compatibility

This commit is contained in:
Laurent Destailleur 2010-05-09 18:20:36 +00:00
parent b8ce801b2b
commit 01eca88aa5

View File

@ -133,13 +133,14 @@ class AdherentOptions
if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname)) if (isset($attrname) && $attrname != '' && preg_match("/^\w[a-zA-Z0-9-_]*$/",$attrname))
{ {
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options_label SET"; $sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent_options_label(name, label, type, pos, size, entity)";
$sql.= " name = '".$attrname."',"; $sql.= " VALUES('".$attrname."',";
$sql.= " label = '".addslashes($label)."',"; $sql.= " '".addslashes($label)."',";
$sql.= " type = '".$type."',"; $sql.= " '".$type."',";
$sql.= " pos = '".$pos."',"; $sql.= " '".$pos."',";
$sql.= " size = '".$size."',"; $sql.= " '".$size."',";
$sql.= " entity = ".$conf->entity; $sql.= " ".$conf->entity;
$sql.=')';
dol_syslog("AdherentOptions::create_label sql=".$sql); dol_syslog("AdherentOptions::create_label sql=".$sql);
if ($this->db->query($sql)) if ($this->db->query($sql))