note 47601 added to function.array-keys

From: Date: Mon, 22 Nov 2004 15:59:03 +0000
Subject: note 47601 added to function.array-keys
Groups: php.notes 
Request: Send a blank email to php-notes+get-80878@lists.php.net to get a copy of this message
Hello, Bonjour à tous et à toutes! I use this code to build my sqlstr: [php]<? $sql = "INSERT INTO table ('"; $sql .= implode("','", array_keys($array)); $sql .= "') VALUES ('"; $sql .= implode("','", array_values($array)); $sql .= "')"; ?>[/php] My $devis array contains two fields that are not in table. Query seems to work as it SEEMS to increment the next auto index as I echo mysql_insert_id after quering. But it does not insert anything into table I need to know how to drop an array field! Thanks! Peace! ---- Manual Page -- http://www.php.net/manual/en/function.array-keys.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47601 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47601&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47601&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80878) next »