Re: Error #1136

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Can you include the SQL statement that is creating the error?

The error basically means you are trying to put more data into the dB then
you have data cells for.

For instance : 

Good sql statement:

$sql = "insert into table (name, address, city, state, zip) VALUES ('$name',
'$address', '$city', '$state', '$zip')";

Bad SQL statement :

$sql = " insert into table (name, address, city, state, zip) VALUES
('$name', '$address', '$city', '$state', '$zip', '$phone')";

The addition of the phone variable would create an error since there is no
column to hold that data.


<?php
/*

Stephen Johnson c | eh
The Lone Coder

http://www.ouradoptionblog.com
Join our journey of adoption

http://www.thelonecoder.com
stephen@xxxxxxxxxxxxxxxx

continuing the struggle against bad code

*/ 
?>


> From: George B <geoizil@xxxxxxxxx>
> Date: Wed, 24 Aug 2005 09:42:19 -0700
> To: <php-general@xxxxxxxxxxxxx>
> Subject:  Error #1136
> 
> Column count doesn't match value count at row 1
> 
> What does that mean? I have an id auto_increment and it breaks everytime
>   because of that error. This has never happend before...
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux