Jump to content

using else after second if


87dave87

Recommended Posts

[code]
<?
include($_SERVER['DOCUMENT_ROOT'] . '/includes/head.php');
include($_SERVER['DOCUMENT_ROOT'] . '/includes/dbconnect.php');
$search_query = "select emulator, version, os, platform, details from windows_atari2600 where emulator LIKE '%".mysql_real_escape_string($_POST["emusearch"])."%' OR platform LIKE '%".mysql_real_escape_string($_POST["emusearch"])."%' order by platform asc, emulator asc";

if (empty($_POST['emusearch']))
{
echo "<meta http-equiv='refresh' content='0; URL=/noresults.php'>";
exit();
}
else
{
$search = mysql_query($search_query);
$num_rows = mysql_num_rows($search);

if($num_rows < 1)
{
  echo "<meta http-equiv='refresh' content='0; URL=/noresults.php'>";
exit();
}
}
?>
[/code]

Do I need to use an else statement after the ' if($num_rows < 1) '  in the else call for if (empty($_POST['emusearch']))
Link to comment
https://forums.phpfreaks.com/topic/28112-using-else-after-second-if/
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.