TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 04-17-2009, 11:09 AM   #1 (permalink)
The Wanderer
 
Join Date: Apr 2009
Posts: 19
Thanks: 9
shankar is on a distinguished road
Default 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'
__________________
--
Regards
Shankar
shankar is offline  
Reply With Quote
Old 04-17-2009, 11:25 AM   #2 (permalink)
The Prestige
Upcoming Programmer Inquisitive 
 
Tanax's Avatar
 
Join Date: Sep 2007
Location: Sweden, Stockholm
Posts: 1,080
Thanks: 115
Tanax is on a distinguished road
Default

Means the column "fname" doesn't exist in the table.
__________________
Tanax is offline  
Reply With Quote
Old 04-17-2009, 12:41 PM   #3 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

Don't use backticks (`) around values. Strings use quotes.
Salathe is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
What am I doing wrong here? Sam Granger General 2 04-16-2009 12:41 AM
Whats wrong with storing your salt in DB? Nor General 10 12-03-2007 03:45 PM
What's wrong? Tanax Absolute Beginners 12 09-20-2007 01:37 PM


All times are GMT. The time now is 07:55 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design