$sizeof = sizeof($strings) + 1; $sizeofagain = sizeof($strings[$x]) + 1; for($x=1;$x<$sizeofagain;$x++) { for($y=1;$y<$sizeof;$y++) { // *build a query using the string* // Echoing just for debugging or whatever. print("INSERT into item_new (id, name, green, eco, dfe, section, category, subcategory) VALUES ('','$name','$green','$eco','$dfe','$x','$y','".$strings[$x][$y]."')
"); } }