sql - how to build loop to insert array in a table -
i have following code:
$var1="bmx" $newdata = implode(",", $dx); $queryinsert = "insert table values ($var1,$newdata)";
but code
insert table values (bmx,black,white, green, yellow,grey)";
and need create new row each color,
insert table values (bmx,white)"; insert table values (bmx,black)";etc...
i think should use foreach don't know how.
you need this. go php docs, find everithing there.
$var1="bmx" foreach ($dx &$value) { $queryinsert = "insert table values ($var1,&$value)"; }
Comments
Post a Comment