0

Can anybody tell me what is wrong with these mysql statements? I believe the LIKE is what is incorrect.

$Find_Query1 = mysql_query("SELECT * FROM pages WHERE title='$Search' AND keywords LIKE '$Search' AND description LIKE '$Search' ");
    $Find_Query2 = mysql_query("SELECT * FROM pages WHERE title LIKE '$Search' AND keywords LIKE '$Search' AND description LIKE '$Search' ");
    $Find_Query3 = mysql_query("SELECT * FROM pages WHERE title LIKE '$Search' AND keywords LIKE '$Search' ");
    $Find_Query4 = mysql_query("SELECT * FROM pages WHERE keywords LIKE '$Search' AND description LIKE '$Search' ");
    $Find_Query5 = mysql_query("SELECT * FROM pages WHERE keywords LIKE '$Search' ");
    $Find_Query6 = mysql_query("SELECT * FROM pages WHERE description LIKE '$Search' ");
2
Contributors
1
Reply
2
Views
6 Years
Discussion Span
Last Post by lyrico
0

Try this Joe.
Just find out the difference of the 3 query. ^^,

$Find_Query1 = mysql_query("SELECT * FROM pages WHERE title='$Search' AND keywords LIKE '%$Search%' AND description LIKE '%$Search%'"); // between
// or
$Find_Query1 = mysql_query("SELECT * FROM pages WHERE title='$Search' AND keywords LIKE '$Search%' AND description LIKE '$Search%'"); //starts with
// or
$Find_Query1 = mysql_query("SELECT * FROM pages WHERE title='$Search' AND keywords LIKE '%$Search' AND description LIKE '$%Search'"); //end with

Edited by lyrico: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.