$sizeof = sizeof($strings) + 1; for($x=1;$x<$sizeof;$x++) { $sizeofagain = sizeof($strings[$x]) + 1; for($y=1;$y<$sizeofagain;$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','". $cate[$x][$y][$z]."','".$strings[$x][$y]."')
"); } }