prepared statement syntax problem
I have this query:
select u.name,u.lastname,t.user_type
from users u
join business_users b on u.user_id=b.crid
join buz_usertype t on b.bus_user_type=t.type_id
where u.lastname like 'P%';
It works on Netbeans console...but when run in a PHP script in a prepared statement it does not:
if($stmt = $connection->prepare('select u.name,u.lastname,t.user_type
from users u
join business_users b on u.user_id=b.crid
join buz_usertype t on b.bus_user_type=t.type_id
where u.lastname like=?%'))
I get this message...related to the syntax:
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 '=?%' at line 5,
What possible can be wrong here?
Subject
Written By
Posted
prepared statement syntax problem
September 08, 2015 05:58AM
September 08, 2015 10:45AM
September 08, 2015 11:13AM
September 08, 2015 01:30PM
September 08, 2015 09:58PM
September 08, 2015 10:13PM
September 08, 2015 10:23PM
September 09, 2015 12:58PM
September 10, 2015 10:26AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.