I'm writing a very simple search script for a tagboard ... pretty much for fun and to learn how. Anyway, i'm not sure how I could set a mysql query to search in more than one field in a table. Could someone give me a general idea of how this is done?
Here's what i have to search the first table:
<?php
$query = "SELECT * FROM tagit WHERE tagitpost LIKE '%$searchtext%'";
$result = mysql_query($query);
# I've tried adding:
# WHERE tagitpost || tagitname || tagiturl
# Using "OR" in place of "||" doesn't make
# much of a difference.
# I'm trying to look for $searchtext in
# 3 seperate fields within the same table.
# tagitpost, tagitname and tagiturl
# If one or more instances of $searchtext
# is found in either of the three fields,
# I want $result to be true.
?>
Any help with this would be appreciated!