我需要對此表進行排序以顯示2個值之間的價格,這些值是使用文本框設置的,但是我嘗試了加載的驗證,但它只是不會工作 這裏是文本框的形式以及我認爲查詢應該是index2.php):PHP - 有人可以幫我做一個SQL排序來獲得2價格值之間的清單嗎?
<form action ="index2.php" method="post">
Games priced<input action="index2.php" method="post" type="text" name="min">
Between<input action="index2.php" method="post" type="text" name="max">
<input type="submit" value="Sort">
<?php
$query = "SELECT * FROM CSGames WHERE price <=min AND >=max ";
$result = pg_query("SELECT * FROM CSGames WHERE price <=min AND >=max ");
?>
,這是SQL數據庫IM期運用
<?php
$con = pg_connect("bla bla");
if (!$con)
{
die('Could not connect: ' . pg_error());
}
$result = pg_query("SELECT * FROM CSGames");
echo "<table>
<tr>
<th>Title</th>
<th>Platform</th>
<th>Description</th>
<th>Price</th>
<th>Select</th>
</tr>";
while($row = pg_fetch_array($result)){
echo"<tr>";
echo "<td>" . $row['1'] . "</td>";
echo "<td>" . $row['2'] . "</td>";
echo "<td>" . $row['3'] . "</td>";
echo "<td>" . $row['4'] . "</td>";
echo '<td><input type="checkbox" name="games[]" value="' . $row['1'] . '|||' . $row['2'] . '|||'. $row['3'] . '|||' . $row['4'] . '"/></td>';
echo"</tr>";
}
echo"</table>";
pg_close($con);
>
我認爲它只是在查詢那是錯誤的,但林不知道? 10,如果有幫助,這是網頁IM上 http://users.aber.ac.uk/edd14/cs25010/index.php
你可以使用? – johnny