What is $array[answer].  Should that be $array[$answer] ?

-----Original Message-----
From: Alex Francis [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 31, 2002 8:07 AM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] Adding to an empty field


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
[EMAIL PROTECTED]
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.



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to