rsammy Posted November 9, 2006 Share Posted November 9, 2006 i am trying this query in my php file. but,it still displays only one of 7 values in the table...HELP PLEASE$querylistdt="SELECT * from oncall order by oncall_id desc limit '5'";$resultlistdt=mysql_query($querylistdt);$rowlistdt=mysql_fetch_array($resultlistdt);$list_date=$rowlistdt["oncall_date"];$list_time=$rowlistdt["oncall_time"];$list_oncallid=$rowlistdt["oncall_id"];$list_oncallorgid=$rowlistdt["oncall_org_id"];$list_oncallphyid=$rowlistdt["oncall_phy_id"]; Link to comment https://forums.phpfreaks.com/topic/26747-help-with-using-limit-in-my-query/ Share on other sites More sharing options...
genericnumber1 Posted November 9, 2006 Share Posted November 9, 2006 you'll need to loop through the results...[code]<?php$querylistdt="SELECT * from oncall order by oncall_id desc limit '5'";$resultlistdt=mysql_query($querylistdt);while ($rowlistdt=mysql_fetch_array($resultlistdt)){ $list_date=$rowlistdt["oncall_date"]; $list_time=$rowlistdt["oncall_time"]; $list_oncallid=$rowlistdt["oncall_id"]; $list_oncallorgid=$rowlistdt["oncall_org_id"]; $list_oncallphyid=$rowlistdt["oncall_phy_id"]; // more loop logic}?>[/code]more info in the forums "common problems, check here first":http://www.phpfreaks.com/forums/index.php/topic,95441.0.html Link to comment https://forums.phpfreaks.com/topic/26747-help-with-using-limit-in-my-query/#findComment-122310 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.