Ok another update

From: Date: Thu, 07 Feb 2002 08:48:42 +0000
Subject: Ok another update
Groups: php.db 
Request: Send a blank email to php-db+get-16597@lists.php.net to get a copy of this message
Hi Everyone, I want to first thank you for helping with the last question I had. It didn't help but I finally figured it out. This one though has me stumped. I have started using a portal script thinking I might be able to see a little better how php works. It will do fine for me as far as my site will go. But here is the problem. I want to tell a user how many days they have left until a certain thing happens. The portal is phpwebthings so if anyone is familiar with it... The problem is I can't figure out how to get the username from the database here is the code I am trying to make work. <? $db["days"]=("UPDATE wt_users set days = days - 1 where uid=$uid"); $result=mysql_query($db["days"]); $query="select name, days from wt_users where uid=$uid"; $ret = mysql_query($query); while(list($name, $days) = mysql_fetch_row($ret)) print("$name you have $days days to complete your questionnaire"); ?> I can't get it to work unless I specify a specific user. Like $query="select name, days from wt_users where uid=1"; How do I pull the user from the session? Also when I do specify a user and refresh the page it updates the count down how do I get it to only update once a day. Any help would be appreciated! Thanks Jennifer Downey

« previous php.db (#16597) next »