freejointventure
asked on
Script SQL query fails to execute
In the following string, an SQL query for data to the database returns an else condition.
This should return data to the index page, however it results in a 404 redirect by script
So were getting a 404 even though we have data in the database where the status is equal to 1
some of the variable names have been changed, because of the nature of the data involved.
Any thoughts on what were missing here or a way to discover what is causing the else redirect condition
$sql = $db->select('table', array('special_url' => $_GET['table_name'], 'status' => 1));
This should return data to the index page, however it results in a 404 redirect by script
if ($sql->exists) {
$name = $sql->fetch();
} else redirect("404.php");
So were getting a 404 even though we have data in the database where the status is equal to 1
some of the variable names have been changed, because of the nature of the data involved.
Any thoughts on what were missing here or a way to discover what is causing the else redirect condition
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Excellent answer thank you.
Glad to help -- thanks for the points and thanks for using E-E, ~Ray
ASKER