最小和最大之间的sql价格

时间:2014-11-23 13:36:50

标签: php html sql forms psql

好吧我需要帮助我试图允许用户输入最低和最高价格然后提交它更新记录但是在momenets显示它。 type(3)类型(pgsql结果)

表格

    <form action ="database_connect.php" method="post">
    Songs price min: <input action="database_connect.php" method="post" type="text" name="minimum">
  </br>
      Songs price max:<input action="database_connect.php" method="post" type="text" name="maximum">
      </br>
       <input type="submit" value="Sort">
         <?php
        echo ($_POST['check_list']);
          $min= "minimum";
       $max= "maximum";
      if (isset($_POST['check_list'])) { 
        echo $_POST['$min'];
      echo $_POST['$max'];
     }
        //error_reporting(~E_ALL);
       $conn = pg_connect("host=db.dcs.aber.ac.uk port=5432 dbname=teaching user=csguest password=r3p41r3d");
        $query = "SELECT * FROM music` WHERE price BETWEEN {$_POST['minimum']} AND        {$_POST['maximum']}";
    $result = pg_query("SELECT * FROM music");
    var_dump($result)           
            ?>
    </form> 

0 个答案:

没有答案