MySQL Operand question

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

I have the following SQL:
Code: [ Select ]
SELECT * FROM wd_tutorials WHERE body = '%programming%' AND type = 'PHP' ORDER BY ID ASC

I don't know if I'm using those percent signs (%) correctly... do I need those quotes with the percent signs? Or am I not doing it correctly at all?

[EDIT:] Right now I tried:
Code: [ Select ]
SELECT * FROM wd_tutorials WHERE body = '%s%' ORDER BY ID ASC

And got 0 results when I know that there should be more
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bogey
  • Genius
  • Genius
  • Bogey
  • Posts: 8388
  • Loc: USA

Post 3+ Months Ago

Nevermind... instead of equal sign (=) in the SQL I was supposed to use LIKE to be able to use percent sighn (%).

Thanks for reading :)

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 108 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.