Thread: logging in
View Single Post
Old 04-30-2008, 06:18 PM   #17 (permalink)
ricrhys
The Wanderer
 
ricrhys's Avatar
 
Join Date: Apr 2008
Posts: 9
Thanks: 0
ricrhys is on a distinguished road
Default so ive got this far

ok so ive got this far but its not quite right can anyone help its displaying all sorts of prices


PHP Code:
More Search options&nbsp<select>
  <option>More Than</option>
  <option>Less Than</option>
  <option></option>
</select><form method="post" action="results.php"><input type="text" name="price" /><input type="submit" /></form>
    <?php $conn pg_connect("host=database.dcs.aber.ac.uk
port=5432 dbname=teaching
user=csguest password=rohishe"
);
$conn pg_connect("host=database.dcs.aber.ac.uk
port=5432 dbname=teaching user=csguest password=******"
);
if (
array_key_exists("lessthan"$_POST))
$res pg_query ($conn"select * from TopGames where price < $_POST[price]");
else 
$res pg_query ($conn"select * from TopGames where price > $_POST[price]");


echo 
"<table border='1'>";
while (
$a pg_fetch_row($res)) {
echo 
"<tr>";
for (
$j 0$j pg_num_fields($res); $j++) {
echo 
"<td>" $a[$j] . "</td>";
}
echo 
"</tr>";}
echo 
"</table>\n";?>
ricrhys is offline  
Reply With Quote