function makeNewLine2($table, $A) { $fields = PMReflector::getAttributesArray($A); #if(PHYNX_MYSQL_STRICT) # $this->fixTypes($table, $A); $values = "NULL"; if (self::$useAsNextID != null) { $values = self::$useAsNextID; self::$useAsNextID = null; } $sets = "`" . $table . "ID`"; for ($i = 0; $i < count($fields); $i++) { if ($fields[$i] == $table . "ID") { continue; } #if(is_numeric($A->$fields[$i])) $values .= ", ".$A->$fields[$i]."\n"; #else $cf = $fields[$i]; $values .= ", '" . $this->cWrite->real_escape_string($A->{$cf}) . "'\n"; $sets .= ",\n`" . $cf . "`"; } $sql = "INSERT INTO\n {$table}\n ({$sets}) VALUES ({$values})"; $_SESSION["messages"]->addMessage("executing MySQL: {$sql}"); Timer::now("sql start", __FILE__, __LINE__); $this->cWrite->query($sql); Timer::now("sql end", __FILE__, __LINE__); DBStorage::$queryCounter++; if ($this->cWrite->error and $this->cWrite->errno == 1054) { preg_match("/[a-zA-Z0-9 ]*\\'([a-zA-Z0-9\\.]*)\\'[a-zA-Z ]*\\'([a-zA-Z ]*)\\'.*/", $this->cWrite->error, $regs); throw new FieldDoesNotExistException($regs[1], $regs[2]); } if ($this->cWrite->error and $this->cWrite->errno == 1062) { throw new DuplicateEntryException($this->cWrite->error); } if ($this->cWrite->error) { throw new StorageException($this->cWrite->error); } if ($this->cWrite->error and PHYNX_USE_SYSLOG) { syslog(LOG_ERR, "MySQL: " . $this->cWrite->error . "(" . $this->cWrite->errno . ") in {$sql}"); } return $this->cWrite->insert_id; }