Jump to content

help with a query


adamdidthis

Recommended Posts

I have the following query:

[code]$sql2=$dbconn->SelectLimit($test = "SELECT u.user_id, u.username, u.user_lastvisit, u.user_regdate, u.user_aim, u.user_yim, u.user_msnm, u.user_email, u.user_viewemail, $postplace, u.user_rank, u.user_from, u.user_occ, u.user_interests, u.user_avatar, u.user_avatar_type
FROM $pntable[phpbb_users] AS u LEFT JOIN $pntable[phpbb_posts] p ON u.user_id=p.poster_i
d GROUP BY u.user_id ORDER BY $order DESC", 1);[/code]

And would like to make it so that it only returns a result if there is something in the u.user_avater column.

So I have tried this:

[code]$sql2=$dbconn->SelectLimit($test = "SELECT u.user_id, u.username, u.user_lastvisit, u.user_regdate, u.user_aim, u.user_yim, u.user_msnm, u.user_email, u.user_viewemail, $postplace, u.user_rank, u.user_from, u.user_occ, u.user_interests, u.user_avatar, u.user_avatar_type
FROM $pntable[phpbb_users] AS u LEFT JOIN $pntable[phpbb_posts] p ON u.user_id=p.poster_i
d WHERE u.user_avatar != "" GROUP BY u.user_id ORDER BY $order DESC", 1);[/code]

But it still doesn't work, any idea whats wrong?
Link to comment
Share on other sites

[!--quoteo(post=354475:date=Mar 13 2006, 12:34 PM:name=adamdidthis)--][div class=\'quotetop\']QUOTE(adamdidthis @ Mar 13 2006, 12:34 PM) [snapback]354475[/snapback][/div][div class=\'quotemain\'][!--quotec--]
And would like to make it so that it only returns a result if there is something in the u.user_avater column.
[/quote]

That's not really necessary. Just process the results with PHP.
Link to comment
Share on other sites

[!--quoteo(post=354502:date=Mar 13 2006, 08:35 AM:name=Masna)--][div class=\'quotetop\']QUOTE(Masna @ Mar 13 2006, 08:35 AM) [snapback]354502[/snapback][/div][div class=\'quotemain\'][!--quotec--]
That's not really necessary. Just process the results with PHP.
[/quote]
Bad advice. You should never return more data from MySQL than you are going to use.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.