Executing an insert into one table of my DB chokes my script.
I get an error:
The row count matches and the fields are large enpough to contain the data.
Table structure is:
here's the code:
actual statement passed to MySQL:
So, I matched up the fields with the values in a spreadsheet to see if they mached; they do. There are thirteen fields and thirteen values. I do not insert into the timestamp field. this should not be a problem.
I tried splitting the insert in to two parts same thing. In another statement I insert one value into a four column table with no problem.
Anybody see an error or know of a certain bug(feature) that might cause this? not looking for a magic bullet but if anyone can point me in the right direction or sees a dumb mistake; I'd appreciate the help.
I get an error:
| Code: |
|
Error: Column count doesn't match value count at row 1 |
The row count matches and the fields are large enpough to contain the data.
Table structure is:
| Code: |
|
Field Type Null Key Default order_id int(11) PRI 0 order_date timestamp YES CURRENT_TIMESTAMP order_busname varchar(50) YES NULL order_fname varchar(50) order_lname varchar(50) order_address varchar(125) order_address2 varchar(125) YES NULL order_city varchar(50) order_state varchar(20) order_zip varchar(10) YES NULL order_tel varchar(25) order_country varchar(50) order_email varchar(100) item_total float(6,2) 0.00 |
here's the code:
| Code: |
|
$cust_info_sth = sprintf("insert into cust_order_info (order_id, order_busname, order_fname, order_lname, order_address, order_address2, order_city, order_state, order_zip, order_tel, order_country, order_email, item_total) values('$order_id, $busname, $fname, $lname, $addr1, $addr2, $city, $state, $post_code, $tel, $country, $email, %01.2f')", mysql_real_escape_string($total)); |
actual statement passed to MySQL:
| Code: |
|
SQL:insert into cust_order_info (order_id, order_busname, order_fname, order_lname, order_address, order_address2, order_city, order_state, order_zip, order_tel, order_country, order_email, item_total) values('20082, Isaan imports, joe, Blow, #123 432 65 Moo 8 T. whiteelephant , none, big city, some prov, 12345, 11 3 123 0203, Thailand, joe@somedomain.com, 541.30') |
So, I matched up the fields with the values in a spreadsheet to see if they mached; they do. There are thirteen fields and thirteen values. I do not insert into the timestamp field. this should not be a problem.
I tried splitting the insert in to two parts same thing. In another statement I insert one value into a four column table with no problem.
Anybody see an error or know of a certain bug(feature) that might cause this? not looking for a magic bullet but if anyone can point me in the right direction or sees a dumb mistake; I'd appreciate the help.
