I try to make a query so i can retrieve x1 as said in title (x1 is in int) but this error appears:
My php code:
echo "the food is:";
echo $food;
$query = "SELECT foodid FROM foods WHERE name = $food";
echo "the query is:";
echo $query;
$result_id = pg_query($conn,$query) or die("Query cannot be executed");
The error:
Warning: pg_query(): Query failed: ERROR: Column "burito" does not exist
I can not understand why somewhere between it turns to lower case.
In the result of echos the name Burito is shown Correct (with capital B). Any hint will be really helpful.
EDIT:
After I fixed this problem with the help of wogsland I noticed that if I echo the $result_id
the outcome is
Resource id #8
But it supposed to be the number 149.