male and female online

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    male and female online

    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

    Code:
     $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&amp;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&amp;sid=$sid\">".$female[0]."</a><br/>";
    i keep getting errors on

    Code:
     $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
    Last edited by brand; 07.11.11, 19:30.
    HELP THEM WHO HELPS YOU



    i only work on wapdesire v_2 coding only

    #2
    Inner join

    (but in caps coding talk wont let me write it in caps :/ )
    Last edited by something else; 07.11.11, 20:07.

    Comment


      #3
      is that instead of a JOIN mate

      this is the error message i got

      Code:
      Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/*************/public_html/online2/tester4.php on line 38
      Last edited by brand; 07.11.11, 20:10.
      HELP THEM WHO HELPS YOU



      i only work on wapdesire v_2 coding only

      Comment


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

        Comment


          #5
          Originally posted by something else View Post
          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

          Code:
              $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
          Code:
              $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



          i only work on wapdesire v_2 coding only

          Comment


            #6
            can anyone help me with this please
            HELP THEM WHO HELPS YOU



            i only work on wapdesire v_2 coding only

            Comment


              #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

              Comment


                #8
                Originally posted by GumSlone View Post
                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



                i only work on wapdesire v_2 coding only

                Comment


                  #9
                  great coding mate......

                  Comment


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

                    Comment


                      #11
                      thanks ori
                      HELP THEM WHO HELPS YOU



                      i only work on wapdesire v_2 coding only

                      Comment


                        #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

                        Comment


                          #13
                          Originally posted by fullcircle View Post
                          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



                          i only work on wapdesire v_2 coding only

                          Comment


                            #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

                            Comment


                              #15
                              Originally posted by fullcircle View Post
                              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
                              Last edited by metulj; 04.12.11, 02:50.
                              HELP THEM WHO HELPS YOU



                              i only work on wapdesire v_2 coding only

                              Comment

                              Working...
                              X