/* We now start to build the query. When finished, a typical query * will look something like this: * SELECT * FROM SHARK WHERE SPECIES='Isurus Paucus' AND AGE=2 */ $query = "select * from sharks where "; if ($species || $age || $location) { $query += " where "; } if ($species) { $query += "species = '$species'"; } if ($age) { if ($species) { $query += " and "; } $query += "age = $age"; } if ($location) { if ($species || $age) { $query += " and "; } $query += "location = '$location'"; } $result = msql("sharks",$query); if (result == -1) { echo("Error : $phperrmsg\n"); exit(1); } $numresults = msql_numrows($result); >