Jump to content

[SOLVED] Problem in your Sql Syntax near row 1


DEVILofDARKNESS

Recommended Posts

I don't see what's the problem in this:

I already had an error in line 1 before, and by changing something in line 7 it was solved, so look carefully at whole the code, maybe you can see the problem?

 

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 '' at line 1

 

echo "<form action='' method='post'><table border='1' height='100% width='100%'>
					<tr><td><b><u>Technology Name</td><td><u><b>Technology Level</u></b></td><td><u><b>Type</u></b></td><td><u><b>Costs</u></b></td><td><u><b>Needs</u></b></td></tr>";
					$getOwnOffLvl = mysql_query("SELECT offensive_level FROM nations WHERE nation_id = '$nationid'") or die(mysql_error());
					list($OwnOffLvl) = mysql_fetch_row($getOwnOffLvl);
					$getOwnDefLvl = mysql_query("SELECT defensive_level FROM nations WHERE nation_id = '$nationid'") or die(mysql_error());
					list($OwnDefLvl) = mysql_fetch_row($getOwnDefLvl);
					$getTechnologies = mysql_query("SELECT * FROM technologies WHERE (((level = '$OwnOffLvl' + 1) AND (type = 'offensive')) Or (((level = '$OwnDefLvl' + 1) AND (type = 'defensive')))") or die(mysql_error());
					while($technologies = mysql_fetch_array($getTechnologies)) {
						echo "<tr><td>" . $technologies['name'] . "</td><td>" . $technologies['level'] . "</td><td>" . $technologies['type'] . "</td><td>" . $technologies['cost'] . "</td><td>" . $technologies['need'] . "</td></tr>";
					}
					echo "</table></form>";

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.