Jump to content

Error... Not sure why. For loops and Insert Into


e1seix

Recommended Posts

Someone help me out here.. why is this generating an error code

 

for ( $i = 1; $i <= 6; $i++ ) {

for ( $j = 1; $j <= 5; $j++ ) {

mysql_query('INSERT INTO shows ( country, series, show, name ) VALUES ( "se", "'.$j.'", "'.$i.'", "Heat '.$i.'" )') or die(mysql_error());

}

}

 

It generates the following:

 

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'show, name ) VALUES ( "se", "1", "1", "Heat 1" )' at line 1

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.