I am trying to fetch data from mysql table :
Here is my code:
rec_id is a VARCHAR(70)
$sql="SELECT rec_id,message,ts FROM msg WHERE rec_id = '". $_SESSION['userData']['id']."'"; $result=mysqli_query($conn,$sql);
where the session data contains id i.e 259137558442865
The query is fetching empty result.
But on removing ‘(single quotes)’ after WHERE around session var, the query works in SQL but still not in php.