Jump to content

sql inserting an array


Nuv

Recommended Posts

Hey guys,

 

I am inserting an array in mysql table

 

$num = count($data);
for ($c=0; $c < $num; $c++)
{
$insert = mysql_query("INSERT into `$table` VALUES('$data[$c]')");
}

 

where $data is just an element in a line which will constitute  fields in mysql

 

Just wanted to know if my sql query is right

Link to comment
https://forums.phpfreaks.com/topic/100673-sql-inserting-an-array/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.