Results 1 to 3 of 3

Thread: PHP / SQL statement *RESOLVED*

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    78

    PHP / SQL statement *RESOLVED*

    Code:
    	if(	!mysql_db_query($sDB, "INSERT $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
    	 )"))
    	{	
    		echo "Error # :";
    		echo mysql_errno(); 
    		echo "<br>"; 
    		echo mysql_error();	
    	}
    prints out:
    Error # :1136
    Column count doesn't match value count at row 1

    There are 11 columns and 11 values being assigned to the columns...so what could be causing the mismatch error?!
    Last edited by Balron; Jun 19th, 2004 at 12:03 PM.
    - Your Local Drunk
    AIM: Asharlin
    YIM: Asharlin
    MSN: [email protected]
    ICQ: 177568857

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    You're assigning 22 values. Re-read the syntax of INSERT statements.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Posts
    78
    Originally posted by CornedBee
    You're assigning 22 values. Re-read the syntax of INSERT statements.
    I'm an idiot, thanks.
    - Your Local Drunk
    AIM: Asharlin
    YIM: Asharlin
    MSN: [email protected]
    ICQ: 177568857

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width