ashras99
12-30-2009, 04:52 PM
I like to export emails from the phpbb database into text file. I need to define specific date of export "from" - "to".
I am using PHPmyadmin for this.
Please tell me what will be the query. Currently i am able to export or emails from this query.
SELECT `user_email` FROM `phpbb_users` GROUP BY `user_email` ORDER BY `user_email`
VIPoint
01-04-2010, 03:51 PM
Use this command
SELECT `user_email` FROM `phpbb_users` GROUP BY `user_email` ORDER BY `user_email` INTO OUTFILE '/tmp/mysqlfile';
This will copy the e-mail accounts to a file /tmp/mysqlfile
ashras99
01-04-2010, 04:28 PM
I think you have not read "I need to define specific date of export "from" - "to" fields.
Mark Muyskens
01-04-2010, 05:37 PM
here's a php script i use to export emails to csv
<?php
$dbhost = 'localhost';
$dbuser = 'username';
$dbpass = 'password';
$dbname = 'mark_forum';
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
mysql_select_db($dbname);
$query="SELECT user_email FROM phpbbforum2008_users WHERE user_email !=''";
$Result = mysql_query($query) or die("Error: " . mysql_error());
header("Content-type:text/octect-stream");
header("Content-Disposition:attachment;filename=email.csv");
while($row = mysql_fetch_row($Result))
{
print '"' . stripslashes(implode('","',$row)) . "\"\n";
}
exit;
mysql_close($conn);
?>
ashras99
01-04-2010, 06:13 PM
where to fill the "from" dates inside this script?
VIPoint
01-05-2010, 02:06 PM
What date are you talking about? date of creation of e-mail account ?
ashras99
01-05-2010, 02:49 PM
yes, date when that account is created or date when account created/updated.
mattle
01-06-2010, 09:07 AM
You just need to add a where clause...I can't remember how phpbb stores dates (UNIX timestamps?).