I forgot to mention that echo
'65.70', 'Coles','34 days','14' - which would appear to be the right syntax?
I'm a php/mysql newbie, and I think this is fairly basic, but having read all of the other questions on this topic and fiddling with different versions of my code for several hours I can't understand what I'm doing wrong. Would very much appreciate any help/suggestions.
Aim: pass data from my php array (
$matrix) into a mysql table
$matrix= (  => 65.70  => Coles  => 34 days  => 14 ) $matrix= (  => 62.70  => Coles  => 13 days  => 14 ) $matrix= (  => 12.70  => Safeway  => 43 days  => 14 )
$matstring=implode("','",$matrix); $matstring="'".$matstring."'"; mysql_query('INSERT INTO Australia (Price, Company, Days, Weight) VALUES ('$matstring')');
(i.e. delete the second line from original code and put double quotes around the argument of mysql_query)
Appreciate user1847757's help - as s/he pointed out,
$matstringitself was correct, but the single quotes inside of
VALUES(' ')were being joined to the single quotes added to
$matstringin the 2nd line of my original code, resulting in
Thanks all for your help & suggestions