Forms

From: Date: Wed, 07 May 2003 05:22:24 +0000
Subject: Forms
Groups: php.general 
Request: Send a blank email to php-general+get-146488@lists.php.net to get a copy of this message
I'm trying to use an image as a submit button in a form and getting some stupid error I just can't figure out. I have four seperate forms on my site and 3 of them work and one doesn't. I have copied and pasted the input line so they are the same in all four, so I am at a loss. This is the line.... <INPUT TYPE="image" src="images/arrow-r.gif" width="56" height="24" border="0"> but .....this will work. <INPUT TYPE="submit" value="Submit"> This is being sent to a PHP script which will then write the form info to a MySQL database - the error I am getting is this: Unknown column 'x' in 'field list'. So where is it getting the column 'x' from? This is the top of the form on all four forms (other than the ACTION = and FORM NAME). <FORM NAME="Update Profile" Target"contentFrame" ACTION="editcheck.php" METHOD="POST" CLASS="formstyle"> The only thing I can think of that is causing the problem is the following, but I have no idea why. Any help is appreciated. $query = "UPDATE $userinfotable SET "; foreach($_POST as $field=>$value) { $upfields[] = "$field='$value'"; } $sqlfields = implode($upfields,","); $query .= $sqlfields. " WHERE userid = '$userid'";

« previous php.general (#146488) next »