Still having problems

$array[answer] is passed from a previous page with this page.

<p align="right">Answer: <TEXTAREA NAME="array[answer]" ROWS=8
COLS=60></TEXTAREA><BR>

<? echo ("<TD><A HREF=\"submit_answer.php?id=$id&task=submit\">Submit
Answer</A></TD>");?></TR>
Have tried changing to array[$answer] on both pages without any luck.

Changed the code to:
$query = "UPDATE submissions SET answers = \"".$array[$answer]."\" where id
= \"$id\"";
and added the following:
 echo mysql_affected_rows();
affected rows returns 0 although query returns the correct id


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.
Rick Emery <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> What is $array[answer].  Should that be $array[$answer] ?
>
> Second, change to:
> $query = 'UPDATE submissions SET answers = \"".$array[$answer]."\" where
id
> = \"$id\"";
>
> Ya gotta quote that text.
>
> -----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