ok screw above questions they decided to pay and i made them a nice little system. This is a preexisting setup they had for searching the database for clubs based on the name. Basically its a drop menu with A-G, H-K, L-Q, R-Z. The form posts properly, but the actual code doesnt work. It must be the if...statements because if i stick echos inside them i get jack shit. It's sloppy but do you guys see any reason the if's wouldnt trip?
$namesearch = $_POST["name"];
if (isset($namesearch))
{
if ($namesearch == "1")
{
echo "foo";
$a = "a";
$b = "b";
$c = "c";
$d = "d";
$e = "e";
$f = "f";
$g = "g";
$sql = "SELECT * FROM asa_eventregister WHERE clubgroupname LIKE '%$a%' OR '%$b%' OR
'%$c%' OR '%$d%' OR '%$e%' OR '%$f%' OR '%$g%'";
$result = mysql_query($sql);
}
if ($namesearch == '2')
{
$a = "h";
$b = "i";
$c = "j";
$d = "k";
$sql = "SELECT * FROM asa_eventregister WHERE clubgroupname LIKE '%$a%' OR '%$b%' OR
'%$c%' OR '%$d%'";
$result = mysql_query($sql);
}
if ($namesearch == '3')
{
$a = "l";
$b = "m";
$c = "n";
$d = "o";
$e = "p";
$f = "q";
$sql = "SELECT * FROM asa_eventregister WHERE clubgroupname LIKE '%$a%' OR '%$b%' OR
'%$c%' OR '%$d%' OR '%$e%' OR '%$f%'";
$result = mysql_query($sql);
}
if ($namesearch == '4')
{
$a = "r";
$b = "s";
$c = "t";
$d = "u";
$e = "v";
$f = "w";
$g = "x";
$h = "y";
$i = "z";
$sql = "SELECT * FROM asa_eventregister WHERE clubgroupname LIKE '%$a%' OR '%$b%' OR
'%$c%' OR '%$d%' OR '%$e%' OR '%$f%' OR '%$g%' OR '%$h%' OR '%$i%'";
$result = mysql_query($sql);
}
if (!$result) {
die("Invalid query: " . mysql_error());
}
}