related to another question that no body answerd.
in another question that i asked before some person helped me but now i am stuck in another situation.
ok now i want to know is there any way in some table we use from two seperate engine like 2 column uid
and username
has myisam engine and lastlogin
which is a timestamp has a memory engine in use.
because i thought its not possible i tryed to make a table onlineusers(MEMORY ENGINE) in database with two columns one was uid
and another one was lastlogin
and then when user wants to login i check database like this and insert if user not exist
$myquery = mysql_query('SELECT COUNT(1) FROM `onlineusers` WHERE uid="'. $row['uid'] . '"');
if(mysql_result($myquery,0) == 0){
$data['uid'] = $row['uid'];
$db->insert("onlineusers",$data);
}else{
updateStatus($row['uid']);
}
and update status function is like this
function updateStatus($uid){
$db = DATABASE::obtain();
$query = mysql_query("UPDATE `onlineusers` set `lastvisit`=now() WHERE uid='".$db->escape($uid)."'");
}
but when i thought about this i figured it out when we restart our server then table of onlineusers will be empty and what will happen for users with cookies set logged in?
then i have to change update function to use two seperate query first query check if uid exist in onlineuses then if not we will insert into it or if exist we have to update timestamp..
now i have another question to ask. using this method is faster to check if exist or not and then update it with updatestatus function which has memory engine ... or just create some timestamp cloumn in my users table and update it on each page check that have myisam engine??