Reputation: 151
I want to be able to order the list from the inner select from the database. My code:
$sql = "SELECT * from `users` WHERE `name` in (select `last` from info where `date` = '2013' ORDER BY `id` DESC)";
I want to be able to get the order from table last
instead of users
.
Upvotes: 0
Views: 55
Reputation: 891
Try this,
Use JOIN
query
$sql = "SELECT u.* from `users` u JOIN `info` i ON u.name = i.last WHERE i.date = '2013' ORDER BY i.id DESC";
Upvotes: 1