Adding to an empty field

From: Date: Thu, 31 Jan 2002 14:07:06 +0000
Subject: Adding to an empty field
Groups: php.db 
Request: Send a blank email to php-db+get-16346@lists.php.net to get a copy of this message
I have an empty field in a mysql database table which needs to have text inserted when my client answers an email. The code is as follows $query = 'UPDATE submissions SET answers = "$array[answer]" where id = "$id" '; // $query = $query . " where id = $id "; // echo ("The query is: <BR>$query<P>\n"); if (mysql_db_query ($dbname, $query, $link)){ echo ("The answer was successfully inserted!<BR>\n"); } else { echo ("The answer could not be inserted!" . mysql_error () . "<BR>\n"); } mysql_close ($link); The query seems to work alright, no errors showing up and "The answer was successfully inserted!" displayed. However, the table is not updated and I cannot see why. The same happens on another page when I try to insert a 'Y'. This script was copied from a third page which works alright. I hope someone can help. I am going mad!!!!!!!. -- Alex Francis Cameron Design 35, Drumillan Hill Greenock PA16 0XD Tel 01475 798106 afrancis@camerondesign.co.uk http://www.camerondesign.co.uk This message is sent in confidence for the addressee only. It may contain legally privileged information. Unauthorised recipients are requested to preserve this confidentiality and to advise the sender immediately of any error in transmission.

« previous php.db (#16346) next »