Jump to content

PHP/MYSQL ERROR


Guest SNIPERBBB
 Share

Recommended Posts

Guest SNIPERBBB

Fixed.$target = $_GET["target"];if ($target == "RED FOX")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "RED FOX" ');elseif ($target == "GREY FOX")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "GREY FOX" ');elseif ($target == "COYOTE")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "COYOTE" ');elseif ($target =="RACCOON")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "RACCOON" ');elseif ($target == "MINK")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "MINK" ');elseif ($target == "OPPOSSUM")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "OPPOSUM" ');elseif ($target == "SKUNK")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "SKUNK" ');elseif ($target == "BEAVER")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "BEAVER" ');else ($target == "MUSKRAT")$result = mysql_query('SELECT * FROM LAND WHERE ANIMAL = "MUSKRAT" ');echo "<table border="1"><tr><th>Set</th><th>Animal</th><th>Blend</th><th>Trap Distance</th><th>Description</th></tr>";while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row["NAME"] . "</td>"; echo "<td>" . $row["ANIMAL"] . "</td>"; echo "<td>" . $row["BLEND"] . "</td>"; echo "<td>" . $row["DISTANCE"] . "</td>"; echo "<td>" . $row["DESCRIPTION"] . "</td>"; echo "</tr>"; }echo "</table>";Thanks in advanceMeh just deleted the if block and made one query like this: $result = mysql_query("SELECT * FROM LAND WHERE ANIMAL LIKE'%$target'");

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...