I posted a thread here before about it and received some help, but it still doesn't work (I posted it almost 2 weeks ago I believe). I've been playing around with the code on my own for a while and still to no avail. I'm trying to add a simple search feature for my site and it's not working. Here's the code:
<form method="get" action="<?PHP_SELF?>">
Search: <input type="text" name="search" style="background:c0c0c0"><br>
<input type="submit" name="subsrch" value="Search" style="background:c0c0c0"><br>
<?php
if($subsrch == "Search") {
$srch = "SELECT * FROM user WHERE name LIKE '%$search%' OR email LIKE '%$search%' OR aim LIKE '%$search%' OR msn LIKE '%$search%' OR icq LIKE '%$search%' OR yahoo LIKE '%$search%'";
if(@mysql_query($srch)) {
while($row = mysql_fetch_array($srch)) {
echo($row['name']);
}
}
}
?>
Any help is appreciated. Thanks 🙂