Little Help

Status
Not open for further replies.

Kanebrah

Member
May 23, 2011
465
98
<div class="UsersCreated"><strong>Time Online
icon_10.png
/strong> <?php echo $user['OnlineTime']; ?></div>

The current code above, shows the whole user base on the hotel's online-time on 1 page, spamming the MYSQL, i would like that code alterd and make it show just that current user who logged in for his stats
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
What CMS are you using, and for that CMS, is there a code (that you can access) that tells you which user is viewing the page?
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
PhoenixPHP & i dont think so

There has to be a system for that? You could simply create a form like this:
PHP:
<form action="checkusers.php" method="post">
Your Username: <input type="text" name="user"> <br />
<input type="submit" name="time" value="Check Time!">
</form>

<?php

if (!isset['time']) {
$result = mysql_query("SELECT * FROM TABLEHERE WHERE user = '$_POST[user]'");

while($user = mysql_fetch_array($result))
  {
  echo "$user['OnlineTime']";
  }

?>
 

Kryptos

prjRev.com
Jul 21, 2010
2,205
1,252
Is that showing 1) The all users list that are online or 2) Number of users online.

RESPONSE:
1.- Delete dat shit.
2.- That's insignificant, it's not "spamming MySQL", don't worry.
 

Meow

Member
Jun 8, 2011
82
1
Is that showing 1) The all users list that are online or 2) Number of users online.

RESPONSE:
1.- Delete dat shit.
2.- That's insignificant, it's not "spamming MySQL", don't worry.

Eehh what do you mean with ''Its not spamming MYSQL'' He has a problem with uploading his database.
 

Jo$h

Posting Freak
Jul 7, 2010
1,030
79
errrm forgot bracket... Try this:
PHP:
<form action="checkusers.php" method="post">
Your Username: <input type="text" name="user"> <br />
<input type="submit" name="time" value="Check Time!">
</form>

<?php

if (!isset['time']) {
$result = mysql_query("SELECT * FROM TABLEHERE WHERE user = '$_POST[user]'");

while($user = mysql_fetch_array($result))
  {
  echo "$user['OnlineTime']";
  }
  }
?>
 
Status
Not open for further replies.

Users who are viewing this thread

Top