You are here: RE: [PHP] Error #1136 « PHP « IT news, forums, messages
RE: [PHP] Error #1136

Posted by Jim Moseby on 08/24/05 21:03

>
> 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

Or, you may be doing:

$sql="INSERT INTO tablename VALUES('$name', '$address', '$city', '$state',
'$zip', '$phone')";

....where your table actually has an auto-increment value in addition to the
6 columns above. This will produce the error too. You will need to specify
the columns in that case, as Stephen correctly stated above.

JM

JM

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация