J
|
Jane 6/22/2006 |
Hi, global $conn; $strSQL = "select * from table1 where userid = ".$_SESSION["UserID"]; $rs = db_query($strSQL,$conn); $data=db_fetch_array($rs); echo "Hello".$data["username"]."welcome back";
global $conn; $str = "select * from logtable where userid = ".$_SESSION["UserID"]; $rslog = db_query($str, $conn); $datalog = db_fetch_array($rslog); echo "last time user logged into sistem ".$data["timestamp"];
|
B
|
bmak author 6/22/2006 |
HI Jane, |
B
|
bmak author 6/22/2006 |
Hi, you can do it using events on the Events tab in the PHPRunner. Here is a sample code for this event: where table1 is your actual table name, username is your actual field name in which username is stored. To add last time user logged into the system create a log table in which this data will be stored. Then insert userid, username and timestamp into log table after user logged in. Use Insert a record into another table action as example for this event. To display last time user logged into sistem use following sample code: where timestamp is you actual field name.
|
J
|
Jane 6/22/2006 |
Sure you can use single table Users and add new field, for example last_logged, in it and then modify event code in the following way: global $conn; $strSQL = "select * from table1 where userid = ".$_SESSION["UserID"]; $rs = db_query($strSQL,$conn); $data=db_fetch_array($rs); echo "Hello".$data["username"]."welcome back last time you logged into sistem ".$data["last_logged"]; |