Skip to content

Instantly share code, notes, and snippets.

@rawwebdesign
Created March 2, 2012 21:07
Show Gist options
  • Save rawwebdesign/1961406 to your computer and use it in GitHub Desktop.
Save rawwebdesign/1961406 to your computer and use it in GitHub Desktop.
the code
<html>
<?php
//this require pulls in the function and db connection variables
require './writetodbconfig.php';
$con = mysql_connect($braddbhost,$braddbuser,$braddbpw);
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// now we are connected and we will start pulling results
// lets see if we can select the database
mysql_select_db($braddbname, $con);
//now we are gonna try to select all results from the table
$query = mysql_query("SELECT * FROM emulators");
// now we starting printing rows
echo "<table style='width: 200px;' class='fitright'><tr><td>When</td><td>URL</td><td>Email</td></tr>";
while($row = mysql_fetch_array($query))
{
echo "<tr><td>";
echo $row['when'];
echo "</td><td style='width: 200px;'>";
echo "<a href='".$row['message']."'>".$row['message']."</a>";
echo "</td><td>";
echo $row['email'];
echo "</td><td>";
echo "<a href='mailto:".$row['email']."'>Send email</a>";
echo "</td></tr>";
}
echo "</table>";
//and then we close just to be careful
mysql_close($con);
?>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment