Reply
PHP inserting vales into MYSQL
Old 01-21-2009, 06:59 AM Re: PHP inserting vales into MYSQL
millwalll's Avatar
Webmaster Talker

Posts: 630
Name: James
Location: KENT
Trades: 2
After running your script i get failure\n
Column count doesn't match value count at row 1
__________________
Www.ebookcabi.net
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
 
When You Register, These Ads Go Away!
Old 01-21-2009, 07:27 AM Re: PHP inserting vales into MYSQL
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
This means that you either are missing a column, or have too much columns specified in your query.
Looking at your query, it's obvious. You have a "SurveyId" field, that you are not indicating in your query.
You should erplace
PHP Code:
INSERT INTO Survey VALUES ('$Email','$Movies','$Score','$Score1','$Score2','$Score'
with
PHP Code:
INSERT INTO Survey (EmailMoviesScoreScore1Score2Score3VALUES ('$Email','$Movies','$Score','$Score1','$Score2','$Score'
That way, you tell the DB which data goes in which columns.
If you left the definition out, it tries to put the first value in the first column.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 01-21-2009, 07:41 AM Re: PHP inserting vales into MYSQL
millwalll's Avatar
Webmaster Talker

Posts: 630
Name: James
Location: KENT
Trades: 2
Hi thanks sorted that problem out Many thanks for all your help
__________________
Www.ebookcabi.net

Last edited by millwalll; 01-21-2009 at 07:56 AM..
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Old 01-21-2009, 02:17 PM Re: PHP inserting vales into MYSQL
millwalll's Avatar
Webmaster Talker

Posts: 630
Name: James
Location: KENT
Trades: 2
Sorted
__________________
Www.ebookcabi.net

Last edited by millwalll; 01-21-2009 at 02:28 PM..
millwalll is offline
Reply With Quote
View Public Profile Visit millwalll's homepage!
 
Reply     « Reply to PHP inserting vales into MYSQL

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11841 seconds with 12 queries