Re: very basic help on query and db issue

From: Date: Tue, 23 Jan 2001 10:00:40 +0000
Subject: Re: very basic help on query and db issue
Groups: php.general 
Request: Send a blank email to php-general+get-36158@lists.php.net to get a copy of this message
Jack, Your table have 12 columns, and you are trying to insert without specify in which columns, in sort that you should insert 12 values. Try: INSERT INTO Hoteldetail (HotelName,HotelLocation, HotelCountry, HotelPostcode, HotelTelephone,Hotelfax,HotelURL, HotelContactFirstName, HotelContactLastName, HotelRoomProvided, HotelEmail) VALUES ('test', 'thai', 'thai', '12', '11', '124', '', 'firstname', 'LastName', 'RoomProvided', 'mail@mm.net'); > > ****************************************************************** > I have a table as shown below and when I tried to run the query ( direct at Mysql db, not from > a php page) : > INSERT INTO Hoteldetail VALUES ('test', 'thai', 'thai', > '12', '11', '124', '', 'firstname', > 'LastName', 'RoomProvided', 'mail@mm.net'); > I got an error said:"ERROR 1136: Column count doesn't match value count at row > 1" > > > +-----------------------+---------------------+------+-----+---------+----------------+ > | Field | Type | Null | Key | Default | Extra | > +-----------------------+---------------------+------+-----+---------+----------------+ > | HotelID | bigint(20) unsigned | | PRI | 0 | auto_increment | > | HotelName | varchar(30) | YES | | NULL | | > | HotelLocation | varchar(30) | YES | | NULL | | > | HotelCountry | varchar(20) | YES | | NULL | | > | HotelPostcode | varchar(10) | YES | | NULL | | > | HotelTelephone | varchar(20) | YES | | NULL | | > | Hotelfax | varchar(20) | YES | | NULL | | > | HotelURL | varchar(30) | YES | | NULL | | > | HotelContactFirstName | varchar(20) | YES | | NULL | | > | HotelContactLastName | varchar(30) | YES | | NULL | | > | HotelRoomProvided | int(10) | YES | | NULL | | > | HotelEmail | varchar(70) | YES | | NULL | | > +-----------------------+---------------------+------+-----+---------+----------------+ > > ************************************************** > > what have I done wrong at the table? > cheers > Jack > jacky@activelifestyle.com > "There is nothing more rewarding than reaching the goal you set for yourself" > -- _______________________________________________ Get your free email from http://www.graffiti.net

« previous php.general (#36158) next »