Hello I have an array ($ar) like the following.
Array
(
[0] => Array
(
[ciao] => 0
)
[1] => Array
(
[ciao] => 44409
)
[2] => Array
(
[ciao] => 44428
)
[3] => Array
(
[ciao] => 44313
)
[4] => Array
(
[ciao] => 42296
)
[5] => Array
(
[ciao] => 44429
)
[6] => Array
(
[ciao] => 42979
)
[7] => Array
(
[ciao] => 42302
)
[8] => Array
(
[ciao] => 42301
)
[9] => Array
(
[ciao] => 43011
)
[10] =>
)
I am trying to insert the array into a mysql table but I only get zeros everywhere with the following code.
"mysql connection"
$i = 0;
for ($i = 0; $i <= 10; $i++) {
$sql = " INSERT INTO table(yo) VALUES('".$ar[$i]."') " ;
echo $ar[$i];
$req = mysql_query($sql) ;
}
mysql_close($db1);
Could anyone help? If I try to echo the $r[$i] it displays the string "array" instead of the proper numbers in the actual array.
$rfrom? Isn't the array called$ar?