male and female online

Started on the old forum in November 2011 · view the original in the archive · old links redirect here

14 replies · 1,061 views · started 15 years ago · 1 min read

TL;DR · summary of 14 replies
  • brand was trying to fix an error in their code where they were only picking up male members online, and wanted to display both male and female members on separate pages.
  • The solution proposed by ori was to join three tables in the query instead of just two as originally attempted.
  • Brand thanked everyone who helped with the issue.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

6 participants
brand Senior · 391 posts #1

can some one please help me i am trying to sort out so my online list can pick up both male and female online but on two diffrent pages

 $male=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online a JOIN profiles b ON a.userid = b.id WHERE b.sex='M'"));
  $main.="Male Online:<a href=\"online.php?action=male&sid=$sid\">".$male[0]."</a><br/>";

  $female=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online a JOIN profiles b ON a.userid = b.id WHERE b.sex='F'"));
  $main.="Female Online:<a href=\"online.php?action=female&sid=$sid\">".$female[0]."</a><br/>";

i keep getting errors on

 $male=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online a JOIN profiles b ON a.userid = b.id WHERE b.sex='M'"));
 
  $female=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online a JOIN profiles b ON a.userid = b.id WHERE b.sex='F'"));
  

can someone please help me with this i am trying to do it for the wapdesire v_2 please

thanks to who ever helps me with it

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

something else Fellow · 2,296 posts #2

Inner join

(but in caps coding talk wont let me write it in caps :/ )

brand Senior · 391 posts #3

is that instead of a JOIN mate

this is the error message i got

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/*************/public_html/online2/tester4.php on line 38

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

something else Fellow · 2,296 posts #4

oops sorry .... yeah needs to be JOIN .... whats the error you getting when it was the other way?

brand Senior · 391 posts #5

something else wrote: oops sorry .... yeah needs to be JOIN .... whats the error you getting when it was the other way?

the error is where its trying to pick up just male and female members so eg:

male members:

tom micky harry

female online: joe lisa wendy

i want it to show it on two pages

so this bit is trying to get just the female members

    $noi=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online JOIN  profiles ON a.userid = b.id WHERE sex='F'"));

and this is to try and get male members

    $noi=mysql_fetch_array(mysql_query("SELECT COUNT(DISTINCT a.userid) FROM online JOIN  profiles ON a.userid = b.id WHERE sex='M'"));

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

GumSlone Administrator Principal · 1,690 posts #7

hmm.....

$noi=mysql_fetch_array(mysql_query("SELECT COUNT(online.userid) FROM online LEFT JOIN profiles ON online.userid = profile.id WHERE profile.sex='M'"));

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

brand Senior · 391 posts #8

GumSlone wrote: hmm.....

$noi=mysql_fetch_array(mysql_query("SELECT COUNT(online.userid) FROM online LEFT JOIN profiles ON online.userid = profile.id WHERE profile.sex='M'"));

thats does not work thanks for helping me gunslone

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

phzone Junior · 18 posts #9

great coding mate......

ori Lead · 512 posts #10

looks like you need to join 3 tables in the query ill get it soon for you lol

fullcircle Junior · 13 posts #12

if u wana setup a free hosting account and upload the basic v2 script i can help ya, cant b assed 2 do it myself lol

brand Senior · 391 posts #13

fullcircle wrote: if u wana setup a free hosting account and upload the basic v2 script i can help ya, cant b assed 2 do it myself lol

fullcircle do u think i am daft i have my own server and my coding is staying there thanks

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

fullcircle Junior · 13 posts #14

dont want ur crappy coding lol i said the basic v2 script that u can download ere. U got ur own server but u cant even code seperate pages 4 for male and female online goodluck 🙂

brand Senior · 391 posts #15

fullcircle wrote: dont want ur crappy coding lol i said the basic v2 script that u can download ere. U got ur own server but u cant even code seperate pages 4 for male and female online goodluck :)

the plain v2 is on here go look for it and i got the pages i need thank you very much i just having problems getting it to show things

i have now fixed this thanks to everyone who helped please close this now thanks

HELP THEM WHO HELPS YOU

External image (may be gone)

i only work on wapdesire v_2 coding only

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close