Nandini Posted October 15, 2008 Share Posted October 15, 2008 Hi I have a mysql database table astaccount. In that there is a field named as accountcode. In database field accountcode values are 9001,9003,9000,58469. In those values i want minimum value. For this i am using MIN function. But it is showing 58469 is minimum and 9003 is maximum . But i want 58469 as maximum and 9000 is minimum. here is my code. <? $least=mysql_query("select MIN(accountcode) as num from astaccount"); $row=mysql_fetch_array($least); $lnumber=$row['num']; echo $lnumber; ?> Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/ Share on other sites More sharing options...
Lamez Posted October 15, 2008 Share Posted October 15, 2008 always use the long tags <?php Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665824 Share on other sites More sharing options...
Nandini Posted October 15, 2008 Author Share Posted October 15, 2008 If i am using the long tags its working fine? Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665843 Share on other sites More sharing options...
Lamez Posted October 15, 2008 Share Posted October 15, 2008 That is not what I am saying, but sometimes when you code a new page using short tags, you might run into some problems. Also could you post the error message you are getting, if any. If not add or die. Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665844 Share on other sites More sharing options...
Nandini Posted October 15, 2008 Author Share Posted October 15, 2008 yaaa you are correct! Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665846 Share on other sites More sharing options...
Lamez Posted October 15, 2008 Share Posted October 15, 2008 Woot! Topic Solved? If so click the "Topic Solved" button! Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665864 Share on other sites More sharing options...
Nandini Posted October 15, 2008 Author Share Posted October 15, 2008 Ok this is my backend server problem. i will solve this problem by taking help of my administrator. Thanx for every cooperation. Quote Link to comment https://forums.phpfreaks.com/topic/128476-solved-mysql-min/#findComment-665875 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.