i can only get exact searches to work. For example: If I search for "the red dog" it returns the query. But if I search for "red dog" it does not work? How do I change this? Thanks!
<?
$search = $HTTP_GET_VARS['search'];
$show = $HTTP_GET_VARS['show'];
?>
<?php
$location = "localhost";
$username = "";
$password = "";
$database = "";
$conn = mysql_connect("$location","$username","$password");
if (!$conn) die ("Could not connect MySQL");
mysql_select_db($database,$conn) or die ("Could not open database");
$color1 = "#ffffff";
$color2 = "#cccccc";
$row_count = 0;
$result=mysql_query("SELECT * FROM tours WHERE $show = '$search' ORDER BY toursDate") or die ("No results found.");
if (mysql_num_rows($result)<1){
echo "<table border='0' cellspacing='0' cellpadding='0' width='750'><tr><td class='text'><strong>The results of your search:</strong><br><br>Sorry, no matches could be found at this time.<br><br>*Make sure you spelled your search correctly.</td></tr></table>";
} else {
$num = mysql_num_rows($result);
$cur = 1;
echo "<table border='0' cellspacing='0' cellpadding='0' width='750'><tr><td><table border='0' cellspacing='1' cellpadding='2' width='100%'><tr><td colspan='6' class='text'>The results of your search:<br><br></td></tr><tr><td class='text'><strong>Artist</strong></td><td class='text' colspan='2'><strong>Date</strong></td><td class='text'><strong>City, State</strong></td><td class='text'><strong>Venue</strong></td></tr>";
while ($num >= $cur) {
$row = mysql_fetch_array($result);
$artist = $row["toursArtist"];
$date = $row["toursDate"];
$city = $row["toursCity"];
$state = $row["toursState"];
$venue = $row["toursVenue"];
$row_color = ($row_count % 2) ? $color1 : $color2;
echo "<tr><td bgcolor=$row_color class='text'>$artist</td><td bgcolor=$row_color class='text'>".date("D",strtotime($date))."</td><td bgcolor=$row_color class='text'>".date("m/d/Y",strtotime($date))."</td><td bgcolor=$row_color class='text'>$city, $state</td><td bgcolor=$row_color class='text'>$venue</td></tr>";
$cur++;
$row_count++;
}
echo "</table></td></tr></table>";
}
mysql_close($conn);
?>