Advertisement
Guest User

Untitled

a guest
Jul 1st, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.35 KB | None | 0 0
  1.                     if(($_GET['priceRange'] != Greater && $_GET['priceRange'] != Less) || $_GET['specifiedprice'] == null){
  2.                         echo "Please go back and fill in all of the form fields.";
  3.                     }else{
  4.                         $conn = pg_connect("host=database.dcs.aber.ac.uk port=5432 dbname=teaching user=csguest password=rohishe");
  5.                         $res = pg_query ($conn, "select title, price from CSGames");
  6.                         $refQuery = pg_query ($conn, "select refnumber from CSGames");
  7.                         echo "";
  8.                             while ($a = pg_fetch_array($res)){
  9.                                 $refNum = pg_fetch_array($refQuery);
  10.                                 if($_GET['priceRange'] == Greater){
  11.                                     if($a[1] > $_GET['specifiedprice']){
  12.                                         echo "";
  13.                                             echo "";
  14.                                             for ($j = 0; $j < pg_num_fields($res); $j++){
  15.                                                 echo "";   
  16.                                             }
  17.                                         echo "";
  18.                                     }
  19.                                 }elseif($_GET['priceRange'] == Less){
  20.                                     if($a[1] < $_GET['specifiedprice']){
  21.                                         echo "";
  22.                                         echo "";
  23.                                         for ($j = 0; $j < pg_num_fields($res); $j++){
  24.                                             echo "";
  25.                                         }
  26.                                         echo "";
  27.                                     }
  28.                                 }
  29.                             }
  30.                         echo "<table border="1"><tbody><tr><td>" . "<input name="selectedGame[]" value="$refNum[0]" type="checkbox">" . "</td><td>" . $a[$j] . "</td></tr><tr><td>" . "<input name="selectedGame[]" value="$refNum[0]" type="checkbox">" . "</td><td>" . $a[$j] . "</td></tr></tbody></table>";
  31.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement