RE: [PHP] Troubles Inserting into MYSQL

From: Date: Mon, 09 Sep 2002 13:11:18 +0000
Subject: RE: [PHP] Troubles Inserting into MYSQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-115732@lists.php.net to get a copy of this message
[snip] if ($update_type == update_Williams) { mysql_query("INSERT INTO events ('user', 'detaildesc', 'index', 'reference', 'date_added') VALUES (\'$cookiewho\', \'$add_Williams\',\'\',\'$row_num\',\'$last_update\')", $sql4) or die ("could not do update"); } [/snip] Try this if ($update_type == update_Williams) { mysql_query("INSERT INTO events (user, detaildesc, index, reference, date_added) VALUES ('" . $cookiewho . "', '" . $add_Williams . "', '', '" . $row_num . "', '" . $last_update . "')", $sql4) or die ("could not do update"); } First of all, seems there is extra stuff in the query that shouldn't be there (what is $sql4?) and you may have parentheses out of place. HTH! Jay

« previous php.general (#115732) next »