TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   Anything wrong with this? (http://www.talkphp.com/absolute-beginners/4150-anything-wrong.html)

shankar 04-17-2009 11:09 AM

Anything wrong with this?
 
Anything wrong with this?

$query2 = mysql_query
("INSERT INTO `school_inspirations`.`student_reg`
(`fname`,`lname`,`initials`,`nationality`,`dob`,`g ender`,`join_date`,`line1`,`area1`,`city`,`state`, `country`,`email_id`,`school`,`board`,`username`)
VALUES
(`$fname`,`$lname`,`$initials`,`$nationality`,`$do b`,`$gender`,`$join_date`,`$line1`,`$area1`,`$city `,`$state`,`$country`,`$email_id`,`$school`,`$boar d`,`$uname`)") or die (mysql_error());


the first name which was entered using a textbox is Shankar, and when i submit the form its giving the error as

Unknown column 'Shankar' in 'field list'

Tanax 04-17-2009 11:25 AM

Means the column "fname" doesn't exist in the table.

Salathe 04-17-2009 12:41 PM

Don't use backticks (`) around values. Strings use quotes.


All times are GMT. The time now is 09:26 AM.

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