Alex Hogan wrote:
Hi All,
I have a form with several values to insert.
I thought that I remember a thread that discussed using a loop to insert
$_POSTed values.
I am trying;
foreach($_POST as $key => $value){
if($key == 'Submit'){
exit;

i think you want break; or continue; here, exit; ends the script execution.

}
else{
$sql = "INSERT INTO registration ('$key')
VALUES ('$value')";
$result = mssql_query($sql);
}
}
I keep getting an invalid object 'registration' error. However
registration is the name of the table. I'm guessing it's someplace else
in the statement that I'm messing up on.

-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to