Hi,
I have a database that stores in a field the number of views for a product.
I want to write a query that gets the two highest views, so I can then
output the result.
I have this so far, but not sure how to adapt it to get the two highest
views.
mysql_query("SE LECT max(views) FROM stock WHERE status='enabled ' AND photo1
!= ''");
I then plan to loop through the results and echo the photo value for each
result.
I am sure this is easy, but just can't figure out the correct syntax.
Thanks,
YoBro
I have a database that stores in a field the number of views for a product.
I want to write a query that gets the two highest views, so I can then
output the result.
I have this so far, but not sure how to adapt it to get the two highest
views.
mysql_query("SE LECT max(views) FROM stock WHERE status='enabled ' AND photo1
!= ''");
I then plan to loop through the results and echo the photo value for each
result.
I am sure this is easy, but just can't figure out the correct syntax.
Thanks,
YoBro
Comment