0

I have 3 queries on a page, that use the same statement structure i have used where statements in all of them. My issue is 2/3 of the queries work. The second query keeps reading me back the error message below, only once i have added a WHERE clause to the query, and the Fatal error disappears once the WHERE clause as been delete.

Fatal error: Uncaught Error: Call to a member function data_seek() on boolean in ... on line 235

Line 235 holds this code.

 $fc_sel->data_seek(0);

My full code

 mysqli_report(MYSQLI_REPORT_INDEX); //overrid a common php nonsense error
 $REST_id = mysqli_real_escape_string($dbc, $_SESSION['Resturant_ID']);
 $fc_sel = $dbc->query("SELECT * FROM Food_Cat WHERE = '$REST_id'");
 $fc_sel->data_seek(0);

 $i = 1;

 while ($output = $fc_sel->fetch_assoc()) {
$fc_run .= $output['Food_Cat_name'] . $output['Food_Cat_Desc'] . '<br>';
$_SESSION['Food_Cat_name'] = $output['Food_Cat_name']; //echo out product name
$_SESSION['Food_Cat_Desc'] = $output['Food_Cat_Desc']; //echo out product desc
$_SESSION['Food_Cat_ID'] = $output['Food_Cat_ID']; //echo out product desc

I have looked all over the internet and i cannot seem to find an answer. Any guidance or a break down of my mistake would be appreciated.

Monroe
  • 177
  • 11

0 Answers0