Jump to content
php.lv forumi

Recommended Posts

Posted

Scirpts izmanto mysql db, proba taada ka nesaprotu kaapeec nedzeesh aaraa vecos ierakstus... MOZGAS NESTRAADAA nevaru izdomaat...

plz paskatieties no malas un pasakiet kur ir kljuuda...

function online(){
$expire = time() - 60;
$rezultats=mysql_query("DELETE FROM online WHERE stamp < $expire");
$ip = getenv("REMOTE_ADDR");
$rezultats=mysql_query("SELECT * FROM online WHERE ip = '$ip'");
$tagadtime = time();

if(mysql_num_rows($rezultats)>0){$rezultats=mysql_query("UPDATE online SET stamp = 

$tagadtime WHERE ip = '$ip'");}
else{$rezultats=mysql_query("INSERT INTO online VALUES ('$ip', $tagadtime)");}

$online_sql=mysql_query("SELECT * FROM online");
$online = intval(mysql_num_rows($online_sql));
echo '.: Onlainā: <b>'.$online.'</b> :.';
}

 

Ps. db connecting ir atsevishkji - ar to probleemu nav! Ierakstiit vinjsh ieraxta db tachu nedzeesh aaraa vecos... :(

Posted

$rezultats=mysql_query("DELETE FROM online WHERE stamp < $expire");

tad skaties sito rindinju, varbuut te lieliec DELETE * FROM, ierubii php.ini lai raada mysql error mesages.

Posted

Stulbums ta taads ka lapa staav uz cita servera kur man nav piekjluves konfiguraacijas failiem... :(

VAINAI IR JAABUUT SCRIPTAA... BET KUR??? ieliku delete * From tachu tik un taa neiet.. :(

Posted
Stulbums ta taads ka lapa staav uz cita servera kur man nav piekjluves konfiguraacijas failiem... :(

uz tava PC taksh ganjau arii ir php un mysql meegini tur vispirms

Posted (edited)

$expire = time() - 60;

 

$rezultats=mysql_query("DELETE FROM online WHERE stamp < $expire");

 

vai tev stamp = unisksiskais vai sql timestamps

taas ir divas atskiriigas lietas ;)

liidz ar to nekad rezultaats neizpildiisies :)

vai nav taa

 

20041230180251<1104458698

 

tobish SQL timestamps nekad nebuus mazaaks pa Uniksisko timestampu ;)

 

P.S. es domaju tieshi vai baazee naff noraadiitc ka tas ir SQL timestamps :)

Edited by Grey_Wolf
×
×
  • Create New...