> foreach($_POST as $key => $value){ > if($key == 'Submit'){ > exit; > } > else{ > $sql = "INSERT INTO registration ('$key') > VALUES ('$value')"; > $result = mssql_query($sql); > } > }
not sure if wrapping columns names in single quotes is valid mssql, try: $sql = "INSERT INTO registration ($key) VALUES ('$value')"; you should also look read up on sql injection attacks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php