<snip>
function insert($table, $data) {
$sql = "INSERT INTO ".$table." SET ";
foreach ($data as $k=>$v) {
$sql.= $k." = '".$v."', ";
}
$sql.=";";
$result = mysql_query($sql);
}
The only problem with the statement is the appended comma to each
iteration - the statement generates a mysql error with the extra comma
at
the end of the statement. This seems like an easy fix -any ideas?
Any help would be greatly appreciated...
</snip>
http://www.php.net/rtrim
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php