View previous topic :: View next topic |
Author |
Message |
Asharlin -
Joined: 11 Jun 2004 Posts: 2
|
Posted: Fri Jun 18, 2004 5:44 pm Post subject: MySQL problem with a SQL statement in php o0 *RESOLVED* |
|
|
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 |
|
 |
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Sat Jun 19, 2004 3:08 pm Post subject: Re: MySQL problem with a SQL statement in php o0 |
|
|
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 |
|
 |
Asharlin -
Joined: 11 Jun 2004 Posts: 2
|
Posted: Sat Jun 19, 2004 6:05 pm Post subject: Re: MySQL problem with a SQL statement in php o0 |
|
|
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 |
|
 |
00squeaky -
Joined: 11 May 2004 Posts: 60
|
Posted: Sun Jun 27, 2004 11:25 pm Post subject: |
|
|
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 |
|
 |
|
|
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
|
|