How do order by another table's column and get the count from other table column so I can order by that.
For example:
$sql="SELECT * FROM photos, views WHERE photos.unqid = views.photoid ORDER BY CAST(views.id AS SIGNED)";
I want to add the views to the photos. So that photos are order by the views.