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

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -