Link to home
Start Free TrialLog in
Avatar of freejointventure
freejointventureFlag for United States of America

asked on

Script SQL query fails to execute

In the following string, an SQL query for data to the database returns an else condition.

 $sql = $db->select('table', array('special_url' => $_GET['table_name'], 'status' => 1));

Open in new window


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");

Open in new window


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
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of freejointventure

ASKER

Thank you ) that is perfect.
Excellent answer thank you.
Glad to help -- thanks for the points and thanks for using E-E, ~Ray