# brought to you by http://thoughtsinbinary.com
$usr = " "; # add SQL user name here
$pwd = " "; # add SQL password here
$dbs = " "; # add SQL database name here
$hst = "localhost"; # usually localhost but check with your server anyway
$cid = mysql_connect($hst, $usr, $pwd);
if (!$cid)
{
echo("ERROR: " . mysql_error() . "\n");
}
?>
# check with your coppermine installation if cpg1410_users is your users table's name
$sql = "SELECT * FROM cpg1410_users ORDER BY user_id";
$retid = mysql_db_query($dbs, $sql, $cid);
if( $retid )
{
while( $row = mysql_fetch_array( $retid ) )
{
$user_id = $row["user_id"];
$user_name = $row["user_name"];
$user_password = $row["user_password"];
$user_email = $row["user_email"];
$user_profile1 = $row["user_profile1"];
$user_profile3 = $row["user_profile3"];
if (!$user_profile3)
{
echo( "INSERT INTO phpbb_users (user_id, username, user_password, user_regdate, user_timezone, user_lang, user_viewemail, user_email, user_from, user_website) VALUES($user_id, '$user_name', '$user_password', '1211068800', 8.00, 'english', 1, '$user_email', '$user_profile1', '$user_profile3');
" );
}
else
{
echo( "INSERT INTO phpbb_users (user_id, username, user_password, user_regdate, user_timezone, user_lang, user_viewemail, user_email, user_from, user_website) VALUES($user_id, '$user_name', '$user_password', '1211068800', 8.00, 'english', 1, '$user_email', '$user_profile1', 'http://$user_profile3');
" );
}
}
}
else
{
die( "Trouble getting contacts from database: " . mysql_error() );
}
?>
mysql_close($cid); ?>