Quote:
Originally Posted by dream2rule
Hello All,
I have a table where i am maintaining the users' ip address and the date when they are accessing the website.
so its like i have 3 fields in the table like
ip_id - auto_increment not null primary key
ip_address - holds the ip address of the user browsing the site
date - the particular date when the user was online on the website
I now need to get the entire list of users and their ip addresses who browsed the website for a particular day.
and this list of users' ip addresses needs to be sent in a mail to the admin of the site.
Any ideas how to go about it?
Regards,
Dream2rule
Hi,
You could select the ip addresses frm the table with an appropriate where clause:
[php]
// $ldDate is defined as the date you are searching for
$lcSelect="Select ip_address from table_name where date = $ldDate";
// run the query
[/php]
You can loop through the resuls of the sql building up the message of your email.
The mail could be sent using the php mail() class. It's really a case of a simple SQL query followed by a loop to process the results.
Have a go at that and if you get stuck post your code and I'll try to help you out some more.
Cheers
nathj