Query doesn't go through with AND syntax included
Posted: Sat Jul 10, 2004 12:24 pm
Hey, thanks for the read. Basically here it is. When I keep it as
$query = "SELECT asReportID, ADtransnum FROM $reports_table WHERE asReportID = '$controlnumber'
$order_by_str $sort_order_str $limit_str";
The search works fine
however there are multiple Agents so it needs to be more specific and grab only where the report iD is equal to $controlnumber and one other field the value of which is stored in session
$query = "SELECT asReportID, ADtransnum FROM $reports_table WHERE RAgency2 = '$_SESSION[id]' AND asReportID = '$controlnumber'
$order_by_str $sort_order_str $limit_str";
now I echoed out the $_SESSION[id] so I know its there and comes up as the appropriate value. Any ideas?
Edit> There was a typo in my last post. This is what the code looks like as above only ONE AND is there it still does not work though.
$query = "SELECT asReportID, ADtransnum FROM $reports_table WHERE asReportID = '$controlnumber'
$order_by_str $sort_order_str $limit_str";
The search works fine
however there are multiple Agents so it needs to be more specific and grab only where the report iD is equal to $controlnumber and one other field the value of which is stored in session
$query = "SELECT asReportID, ADtransnum FROM $reports_table WHERE RAgency2 = '$_SESSION[id]' AND asReportID = '$controlnumber'
$order_by_str $sort_order_str $limit_str";
now I echoed out the $_SESSION[id] so I know its there and comes up as the appropriate value. Any ideas?
Edit> There was a typo in my last post. This is what the code looks like as above only ONE AND is there it still does not work though.