Ok, I think my brain is officially off being memorial day weekend or something but I'm trying to do a simple database query but I want to search through the query results to see if all or "part" of the results match my query. I can get the "all" part with a normal query (like below) but how do I search to see if only part of the retults match?
$my_link_query = mysql_query( "SELECT * FROM mydb WHERE link_name='$query'" );
Thanks,
Jr-
Query part of a MySQL return
Moderator: General Moderators
Possibly using LIKE:
Essentially returns records with `searchfield` that matches characters before or after the search string.
MySQL Manual: String Comparison Functions
Code: Select all
SELECT
somefield
, someotherfield
FROM sometable
WHERE searchfield LIKE '%{$query}%'
;MySQL Manual: String Comparison Functions