20 replies · 1,998 views · started 19 years ago · 1 min read
TL;DR · summary of 20 replies
$lastview = mysql_fetch_array(mysql_query("SELECT bywho FROM members WHERE username='".$name."'")); then add following code, echo "Last Viwed by: $lastview[0]"; Now it should work.
Guest had issues with the code not updating on site despite database updates working properly.
Guest's issue was resolved after using the provided code snippet.
Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.
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
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)
<?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."'"));
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?
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)