dharm Posted September 26, 2006 Share Posted September 26, 2006 Hi, im trying to find a way where I can get the highest profile_id number from a group of profiles owned by a particular user..The table “profiles” also contains other users profile(s). here is the part of the code im workin with:[quote] <?php $query = "Select MAX(profile_no) from ".$DBprefix."profiles GROUP BY where pro_id='$cid'"; // $cid is the users unique account number. ?> [/quote]any help will be much appreciated .. thx! Link to comment https://forums.phpfreaks.com/topic/22098-selecting-a-group-from-a-table-of-many/ Share on other sites More sharing options...
ToonMariner Posted September 26, 2006 Share Posted September 26, 2006 <?php $query = "Select profile_no from ".$DBprefix."profiles where pro_id='$cid' ORDER BY profile_no DESC LIMIT 0,1"; // $cid is the users unique account number. ?> Does that work???? Link to comment https://forums.phpfreaks.com/topic/22098-selecting-a-group-from-a-table-of-many/#findComment-98968 Share on other sites More sharing options...
fenway Posted September 26, 2006 Share Posted September 26, 2006 And what are you getting now? Link to comment https://forums.phpfreaks.com/topic/22098-selecting-a-group-from-a-table-of-many/#findComment-99111 Share on other sites More sharing options...
dharm Posted September 26, 2006 Author Share Posted September 26, 2006 Spot on mate!! thank you!! Link to comment https://forums.phpfreaks.com/topic/22098-selecting-a-group-from-a-table-of-many/#findComment-99321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.