Lacuna
1
Hey All,
I’ve searched and searched and can’t find this answer.
How do I grab all of the emails from a database on my server and post them onto a webpage in a list like:
serethablaze@hotmail.com; meagain@hotmail.com; and so on…
Thanks in advance, I just cant get it right…
~ Seretha :love:
system
2
well you have to connect to the database , get the results from the table and then echo it out… in a longer verison…
<?
//some settings
$dbname = "email_list_DB";
$dbhost = "localhost";
$dbuser = "root";
$dbpass = "";
$limit = "40";
//___________
// connect to DataBase
$link = mysql_connect($dbhost, $dbuser, $dbpass) or die("Error!");
mysql_select_db($dbname, $link) or die("Error!");
//___________
// get the list
$select = "SELECT id, email FROM email_table order by id asc";
$result = mysql_query($select);
$nrows = mysql_num_rows($result);
// sdraw HTML00
echo"EMAIL LIST :";
echo"<br>";
for ($z=0; $z < $nrows; $z++) {
$row = mysql_fetch_array($result);
echo"<b>EMAIL ADDRESS : </b>".$row[2]."";
echo"<br>";
}
//end of it
?>
hope it helps.