Jump to content

Archived

This topic is now archived and is closed to further replies.

dharm

selecting a group from a table of many

Recommended Posts

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!

Share this post


Link to post
Share on other sites
<?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????

Share this post


Link to post
Share on other sites
And what are you getting now?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.