TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Help with Form submission (http://www.talkphp.com/absolute-beginners/6036-help-form-submission.html)

capricorn 11-16-2011 01:33 PM

Help with Form submission
 
Hi all,

Can you please assist me with this issue I'm having - Error registering new patient: Unknown column 'dob' in 'field list'(the error message I'm getting once I have clicked submit on my form) and this is my INSERT TO statement - $sql = "INSERT INTO patient_information(surname, firstname, middlename, sex, dob, age, address, address2, address3, parish, nationality, maritalstatus, telephone, cellphone, occupation, nextofkin) VALUES ('$Surname', '$Firstname', '$Middlename',
'$Sex','$Date_of_Birth', '$Age', '$Address_line1', '$Address_line2', '$Address_line3', '$Parish', '$Nationality', '.$Marital_Status', '$Tel_No', '$Cell_No', '$Occupation', '$Next_of_Kin')";

if (@mysql_query($sql)) {
echo('<p> New patient registered</p>');
}else{
echo('<p>Error registering new patient: ' .mysql_error() . '</p>');
}.

Help needed urgently please.

Capricorn

tony 11-16-2011 02:50 PM

I am assuming you made sure that all those fields exist in the table. The other thing I would do is to take of the @ from the line that has the mysql query so that it would show more details on the error. And maybe info on the fields would let us know what the table has. Something like:
SQL Code:
SHOW COLUMNS FROM patient_information;

RokD 11-16-2011 10:08 PM

Quote:

Unknown column 'dob' in 'field list
Just check the field names again ;)


All times are GMT. The time now is 07:50 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0