MySQL problem with a SQL statement in php o0 *RESOLVED*

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Asharlin
-


Joined: 11 Jun 2004
Posts: 2

PostPosted: Fri Jun 18, 2004 5:44 pm    Post subject: MySQL problem with a SQL statement in php o0 *RESOLVED* Reply with quote

Code:

   if(   !mysql_db_query($sDB, "INSERT INTO $sTableName VALUES (
      '$sUsername'      ,0,
      '$sPassword'      ,1,
      '$sE_Mail'        ,2,
      '$sAge'         ,3,
      '$sName'      ,4,
      '$sCountry'      ,5,                
      '$sSex'         ,6,
      '$sSecret_Question'   ,7,
      '$sSecret_Answer'   ,8,
      '$sState'      ,9,
      '$iPID'         ,10
    )"))


I get error 1136 for Row 1 which is basically # of columns doesn't match # of values...

There is 11 columns so I'm trying to figure out how that could be?[/code]


Last edited by Asharlin on Sat Jun 19, 2004 6:05 pm; edited 1 time in total
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Jun 19, 2004 3:08 pm    Post subject: Re: MySQL problem with a SQL statement in php o0 Reply with quote

Asharlin,

You should modify your code to get a "human readbale" error message from MySQL to help you understand what's the problem. Read http://www.aprelium.com/forum/viewtopic.php?t=4619 for more information.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Asharlin
-


Joined: 11 Jun 2004
Posts: 2

PostPosted: Sat Jun 19, 2004 6:05 pm    Post subject: Re: MySQL problem with a SQL statement in php o0 Reply with quote

aprelium wrote:
Asharlin,

You should modify your code to get a "human readbale" error message from MySQL to help you understand what's the problem. Read http://www.aprelium.com/forum/viewtopic.php?t=4619 for more information.


what do you think came after in the if statement =0 And how did you think I got the error message? =)

Anyway, it was an idiotic mistake heh and its fixed!
Back to top View user's profile Send private message
00squeaky
-


Joined: 11 May 2004
Posts: 60

PostPosted: Sun Jun 27, 2004 11:25 pm    Post subject: Reply with quote

icky code. it should look like this.

Code:

$sql = " insert into "'.$tablename.'" (username,password,etc) values ('".$username."','".$password."',etc) ";

if (!$sql) {
not statement ;
}

_________________
Languages mastered:
HTML,GML,C,PHP,MYSQL (not really a language, but wtf)
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group