. tell me how to modify in the above code that if the user is entering for first time then using time() or sessionid it should be stored or else if he is entering for first time then using current time() or sessionid it must be stored.....
msi_333
Question subject: Re: login using sessionid or time
Posted: Thu Sep 22, 2011 11:14 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
you want to save first time login date ! , you have to save such information in database or text file which i don't recommend.
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
ravi951
Question subject: Re: login using sessionid or time
Posted: Thu Sep 22, 2011 11:17 am
Joined: Tue Aug 09, 2011 12:50 pm Posts: 7 Has thanked: 0 time Have thanks: 0 time
i need to store in my database
msi_333
Question subject: Re: login using sessionid or time
Posted: Thu Sep 22, 2011 11:59 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time
if (!$dbconnection) { die (" cannot connect to database"); }
$result=mysql_select_db ("databasename");
if (! $result) { die ("database could not be selected"); }
echo "Database ready."; ?>
Code:
$query_res = mysql_query( "SELECT * from tableName" );
you may create a data column in users table , if its first time , store the time , any new visits check this column value , it null so its new visit , else it is not and do nothing.
_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
ravi951
Question subject: Re: login using sessionid or time
Posted: Thu Sep 22, 2011 12:37 pm
Joined: Tue Aug 09, 2011 12:50 pm Posts: 7 Has thanked: 0 time Have thanks: 0 time
how it will store the time in the database
msi_333
Question subject: Re: login using sessionid or time
Posted: Fri Sep 23, 2011 1:32 am
Joined: Tue Mar 27, 2007 10:55 pm Posts: 2279 Location: Earth Has thanked: 39 time Have thanks: 61 time