Jump to content
php.lv forumi

online cilvēki


Vecteevs

Recommended Posts

Sveiki, izveidoju online skriptu, bet apjuku un nevaru parādīt online nikus kāds var palīdzēt?

<?
include ("dbc.php");
$time = time();
$laiks=400;

mysql_query("UPDATE users SET redzets='$time' WHERE user_email='$_SESSION[lietotajs]'");


$query = mysql_query("SELECT user_email, id, redzets FROM users WHERE redzets > '".$time-laiks."'   ");

?>

Link to comment
Share on other sites

nu tad vajag kārtīgi paskaidrot :)

 

<?
include ("dbc.php");
$time = time();
$laiks=400;

mysql_query("UPDATE users SET redzets='$time' WHERE user_email='$_SESSION[lietotajs]'");

$query = mysql_query("SELECT user_email, id, redzets FROM users WHERE redzets > '".$time-laiks."'   ");
while($arr = mysql_fetch_array($query))
{
echo '<a href="manalapa.lv?lietotajs=' . $arr[1] . '">' . $arr[0] . '</a> <small>Pēdējo reizi redzēts' . $arr[2] . '</small>'; 
}

?>

Edited by eT`
Link to comment
Share on other sites

Pamēģini šādi, visam būtu jāiet - >

 

<?

include ("dbc.php");

$time=time();

$laiks2 = time()-400;

 

mysql_query("UPDATE users SET redzets=$time WHERE user_email='$_SESSION[lietotajs]'");

 

$query = mysql_query("SELECT user_email, id, redzets FROM users WHERE redzets > $laiks2");

while($arr = mysql_fetch_array($query))

{

extract($arr);

 

echo "<a href='http://www.xxxxx.lv/?lietotjs=".$arr['id']."'>".$arr['user_email']." pēdējo reizi redzēts".$arr['redzets'];

}

 

?>

Edited by Uldis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...