Profile Last Viewed By

Started on the old forum in September 2007 · view the original in the archive · old links redirect here

20 replies · 1,998 views · started 19 years ago · 1 min read

4 participants
Guest #1

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 External image (may be gone) , 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

Guest #2

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

Guest #3

Right its updatin in database but not on site. Can anyone see what i'm missin please External image (may be gone)

?>

External image (may be gone)

<?php $sqlthing = mysql_query("SELECT * FROM members WHERE username='$name'"); $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='$name'"); $onlinetime=(mysql_result($sqlthing,0,"onlinetime"));
Guest #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 External image (may be gone)

Guest #5

Right its updatin in database but not on site. Can anyone see what i'm missin please External image (may be gone)

?>

External image (may be gone)

<?php $sqlthing = mysql_query("SELECT * FROM members WHERE username='$name'"); $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='$name'"); $onlinetime=(mysql_result($sqlthing,0,"onlinetime"));

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

CODE$lastview = mysql_fetch_array(mysql_query("SELECT bywho FROM members WHERE username='".$name."'"));

then add following code,

CODEecho "Last Viwed by: $lastview[0]";

Now it should work

WhiteWarrior Principal · 1,419 posts #6
?>

[img]bar2.gif[/img]
<?php
$sqlthing = mysql_query("SELECT * FROM members WHERE username='$name'");
$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='$name'");
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='$name'");
$onlinetime=(mysql_result($sqlthing,0,"onlinetime"));

that should also work

Guest #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

Guest #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

CODE $lastview = mysql_fetch_array(mysql_query("SELECT bywho FROM members WHERE username='".$name."'"));

then add following code,

CODEecho "Last Viwed by: $lastview[0]";

Now it should work

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

Bro i think its not updating in database properly... What the code u used for that?

WhiteWarrior Principal · 1,419 posts #10

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

Guest #11

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

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 External image (may be gone)

WhiteWarrior Principal · 1,419 posts #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

ReGzBk Developer · 115 posts #15

I want to implement this things in chat script can anyone help ? hw can i get lastlogged in time ??

ViSiT Ma SiTe Nd PoSt Ua CoMmEnTs On It In Ma PoSt

ReGzBk Developer · 115 posts #17

I m not using SP script m using Chatzone SCript how to do it in tht ?? ..

ViSiT Ma SiTe Nd PoSt Ua CoMmEnTs On It In Ma PoSt

ReGzBk Developer · 115 posts #19

ahan thnx mate i wud give it a try nd let u kno .....

ViSiT Ma SiTe Nd PoSt Ua CoMmEnTs On It In Ma PoSt

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