i've looked online and so far i've only gotten scripts of the search engines where they do full-text searches or the ones that retrieve one variable in the database and retrieve it. i've been able to squeeze in 2 variables but when i do more, it starts to mess up. just wondering if there was a better way of doing this, rather than setting all empty variables to an abiguous number that will match all comps. so to recap, i have 2 questions.
1. how do you filter out more than 1 variable in a mysql database search?
2. is there a better way to do this than what i'm doing?
<?php
include("connect.php");
include("head.php");
//get variables
$brand = ("[^a-z0-9A-Z]", "",$_POST["brand"]);
$hddcap = ("[^a-z0-9A-Z]", "",$_POST["hddcap"]);
//if hddcap does not exist, makes it 0
if (!$hddcap)
{$hddcap = 0;}
echo "<center>Results</center><BR>";
//print results
$result = mysql_query("SELECT * FROM computers WHERE brand LIKE '%$brand%' && hddcap>'%$hddcap%' ORDER BY series, model");
while ($row = mysql_fetch_array($result))
{
echo "<a href='computer.php?id=" . $row['id'] . "'>" . $row['brand'] . "'s " . $row
['series'] . " " . $row['model'] . "</a><br>";
}
include("foot.php");
?>