[SOLVED] error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

error

Post by pinehead18 »

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 '%pup%' at line 1

what does this error usually mean?

thank you
Anthony
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

What does the full query look like?
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

$sql = "SELECT * FROM users WHERE 1=1 AND user LIKE %$s%";
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

You're missing the single quotes around the value,
$sql = "SELECT * FROM users WHERE 1=1 AND user LIKE '%$s%'";
pinehead18
Forum Contributor
Posts: 329
Joined: Thu Jul 31, 2003 9:20 pm

Post by pinehead18 »

haha thanks man!!
Post Reply