Jump to content

[SOLVED] multiple records with one sql statement


samona

Recommended Posts

is there a way to insert more than one record into the database without have to have a loop as I have below?

 

for ($i = 1; $i <= 4; $i++)
{
$index = "info_{$i}";


	$query = "Update table SET column = '{$_POST[$index]}' WHERE column_ID = $i";

	if (!($result = @mysql_query($query, $connection)))
	{
		die ('Could not query the databases: ' . mysql_error());
	}

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.