I’m building a website and I have tested this sql statement on the production server and it works, no errors and returns the correct results. But when I execute it via php, it tells me I have an error.
$query = "SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
select r.id, r.name from recipes r inner join fav5 f on r.id=f.recipeid where f.memberid='$id'";
This is the error when used in a php script:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘select r.id, r.name from recipes r inner join fav5 f on r.id=f.recipeid where f.’ at line 2
What the heck is going on!
Cant use delimiters (;) in sql from php
It’s a security issue, one line at a time.