I am trying to insert data from an array in mysql. I have multiple arrays. I have been trying to do something along the lines of this.
foreach ($titles as $title && $descriptions as $description) {
mysql_query("INSERT INTO `stock` VALUES('', '$title', '$description')");
}
I would like mysql table to look like this.
item_id title description
_______________________________
1 title1 description1
2 title2 description2
...
Now I have figured out this won't work is there any alternative to this. I have seen examples of while loops to do this but i am struggling to understand how that would work. All help is appreciated in advance.