Re: MySql Update.
| From: | Marco Tabini | Date: | Tue, 12 Nov 2002 18:55:13 +0000 |
| Subject: | Re: MySql Update. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-23256@lists.php.net to get a copy of this message | ||
How about:
function do_query ($table, $fields, $where)
{
$sql = 'update ' . $table . ' Set ';
foreach ($fields as $k=>$v)
$sql = $k . ' = \'' . $v . '\',';
return mysql_query ($sql);
}
Not sure if it adapts 100% to your case but you can probably fix it
up...
Marco
--
------------
php|architect - The magazine for PHP Professionals
The monthly worldwide magazine dedicated to PHP programmers
Come visit us at http://www.phparch.com!