Profile Last Viewed By

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

    Profile Last Viewed By

    I've been working on the above, using sp code, but i keep getting the following error on profiles and i cant see why, ive added the right bits to the database so dont understand why i'm getting the error, can anyone help please , I have added the code to the profile file so its not that ..


    Warning: mysql_result() [function.mysql-result]: bywho not found in MySQL result index 8 in /home/******/public_html/profile.php on line 79

    #2
    Got rid of the error.. its just not updating now.. but i'm getting there lol

    Comment


      #3
      Right its updatin in database but not on site. Can anyone see what i'm missin please

      ?>


      [img]bar2.gif[/img]
      <?php
      $sqlthing = mysql_query("SELECT * FROM members WHERE username=&#39;$name&#39;");
      $reg=(mysql_result($sqlthing,0,"registerdate"));
      $lp=(mysql_result($sqlthing,0,"lastpost"));
      $in=(mysql_result($sqlthing,0,"lastloggedin"));
      $bywho=(mysql_result($sqlthing,0,"bywho"));
      echo "
      Reg Date: $reg";
      echo "
      Last seen online: $in";
      echo "
      Profile Last Viewed By:$bywho";
      printf($bywho);
      //printf($bywho);

      //$bywho=(mysql_result($sqlthing,0,"bywho"));
      $sqlthing = mysql_query("SELECT * FROM profile WHERE username=&#39;$name&#39;");
      $onlinetime=(mysql_result($sqlthing,0,"onlinetime" ));

      Comment


        #4
        Does anyone know why its not updating on site, database is working ok, but where it says profile last viewd by is blank on site

        Comment


          #5
          Right its updatin in database but not on site. Can anyone see what i&#39;m missin please

          ?>


          [img]bar2.gif[/img]
          <?php
          $sqlthing = mysql_query("SELECT * FROM members WHERE username=&#39;$name&#39;");
          $reg=(mysql_result($sqlthing,0,"registerdate"));
          $lp=(mysql_result($sqlthing,0,"lastpost"));
          $in=(mysql_result($sqlthing,0,"lastloggedin"));
          $bywho=(mysql_result($sqlthing,0,"bywho"));
          echo "
          Reg Date: $reg";
          echo "
          Last seen online: $in";
          echo "
          Profile Last Viewed By:$bywho";
          printf($bywho);
          //printf($bywho);

          //$bywho=(mysql_result($sqlthing,0,"bywho"));
          $sqlthing = mysql_query("SELECT * FROM profile WHERE username=&#39;$name&#39;");
          $onlinetime=(mysql_result($sqlthing,0,"onlinetime" ));[/b]
          Well ok since u say lastview is updated properly in ur database I assume dat part is working ok..
          And also assume value for $name variable is retrieved properly... If so why not try following code

          <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$lastview = mysql_fetch_array(mysql_query("SELECT bywho FROM members WHERE username=&#39;".$name."&#39;"));</div>

          then add following code,

          <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>echo "Last Viwed by: $lastview[0]";</div>

          Now it should work

          Comment


            #6
            Code:
            ?>
            
            
            [img]bar2.gif[/img]
            <?php
            $sqlthing = mysql_query("SELECT * FROM members WHERE username=&#39;$name&#39;");
            $reg=(mysql_result($sqlthing,0,"registerdate"));
            $lp=(mysql_result($sqlthing,0,"lastpost"));
            $in=(mysql_result($sqlthing,0,"lastloggedin"));
            $bywho=(mysql_result($sqlthing,0,"bywho"));
            echo "
            [size="1"][b]Reg Date: [/b][/size] $reg";
            echo "
            [size="1"][b]Last seen online: [/b][/size] $in";
            $lv = mysql_query("SELECT bywho FROM members WHERE username=&#39;$name&#39;");
            echo "
            [size="1"][b]Profile Last Viewed By:[/b][/size]$lv";
            printf($bywho);
            //printf($bywho);
            
            //$bywho=(mysql_result($sqlthing,0,"bywho"));
            $sqlthing = mysql_query("SELECT * FROM profile WHERE username=&#39;$name&#39;");
            $onlinetime=(mysql_result($sqlthing,0,"onlinetime"));
            that should also work

            Comment


              #7
              Many thanks,will give it a go

              Comment


                #8
                Thank you for your help i now get the following

                Reg Date: 2007-08-17 18:57:16
                Last seen online: 2007-10-07 15:30:54
                Profile Last Viewed By:Resource id #12

                Comment


                  #9
                  Well ok since u say lastview is updated properly in ur database I assume dat part is working ok..
                  And also assume value for $name variable is retrieved properly... If so why not try following code

                  <div class='codetop'>CODE
                  <div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$lastview = mysql_fetch_array(mysql_query("SELECT bywho FROM members WHERE username=&#39;".$name."&#39;"));</div>

                  then add following code,

                  <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>echo "Last Viwed by: $lastview[0]";</div>

                  Now it should work[/b][/quote]


                  Thank you for your help i now get the following

                  Reg Date: 2007-08-17 18:57:16
                  Last seen online: 2007-10-07 15:30:54
                  Profile Last Viewed By:Resource id #12[/b]
                  Bro i think its not updating in database properly... What the code u used for that?

                  Comment


                    #10
                    the code i gave you works fine... i done it ages ago for someone elses site

                    Comment


                      #11
                      the code i gave you works fine... i done it ages ago for someone elses site[/b]
                      I must of done thing wrong then,it comes up viewed by "Profile Last Viewed By:Resource id #12" back to the drawing board me thinks

                      Comment


                        #12
                        put your whole script to .rar and ill do it for ya or just give me the profile sql and the whole profile page

                        Comment


                          #13
                          Big Thank you Drugsbunny for your help, your a *

                          Comment


                            #14
                            You&#39;re Welcome :-)

                            Comment


                              #15
                              I want to implement this things in chat script can anyone help ? hw can i get lastlogged in time ??
                              <span style="font-size:12pt;line-height:100%"><span style="color:#FF0000">ViSiT Ma SiTe Nd PoSt Ua CoMmEnTs On It In Ma PoSt</span></span>

                              Comment

                              Working...
                              X