I am trying to figure it out for lot of hours now to no avail. When I use the mysql for query it show the result, but when I tried it to run it at php, it does not show a result.
Code1
[code=php] $sql=”SELECT * FROM infotest where (status=2 or status=3) and tt_ID=”.$ap_id. ” “;
$sid3=’40152′;
$sql .= ” and school_ID='”.$sid3.”‘”;
I am missing a space or something in my sql? How about the code below, Am I missing a space or something in my sql?
Code 2
[code=php] $sql=”SELECT * FROM infotest where (status=2 or status=3) and tt_ID=”.$ap_id. ” “;
foreach($sid as $sid2)
{
$sql_concat .=” or school_ID=”.$sid2.””;
}
$sid3=’40152′;
$sql .= ” and (school_ID='”.$sid3.”‘”;
$sql .=$sql_concat.”)”;