RE: [PHP] Error #1136

From: Date: Wed, 24 Aug 2005 18:03:33 +0000
Subject: RE: [PHP] Error #1136
Groups: php.general 
Request: Send a blank email to php-general+get-221293@lists.php.net to get a copy of this message
> > 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

« previous php.general (#221293) next »