Hello, I need a help to sorting data from php table by using a dropdown menu..
The table is reservations and im going to sort the reserve_Date where when I click the reserve Date then the data will be display..
Can someone help me?

This the code form dropdown menu
<form action='reservationDate.php' method='post' >
<select name="date">
<option value="sortbyDate" selected="selected">Sort by Date: </option>
<option value="reserve_Date">Reserve Date</option>
</select>
<input type="submit" value='submit' />
</form>

If you are using sql to sort the data it would look something like this.

$sql = "SELECT * FROM reservations ORDER BY date ASC";
or
$sql = "SELECT * FROM reservation ORDER BY reserve_date ASC";

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.