Hello,
This query works when entered directly into MySQL but when used in a php page it fails and generates the following error:
Column count doesn't match value count at row 3
Also, the date values are not accepted in either the php page or mysql terminal, they default to '0000-00-00'.
Here is my query:
mysql_select_db("ecommerce");
$query = "INSERT INTO products VALUES (
'00001', 'toothbrush',
'Brush your teeth with this.',
395.00, '2009-21-04'),
('00002', 'tooth paste',
'You will need this too.',
695.00, '2009-21-04'),
('00003', 'mouth wash',
'Good to use after toothbrush.',
1,250.00, '2009-21-04')";
$result = mysql_query($query)
or die(mysql_error());
echo "Products added successfully!";
What do you guys think?