$dbcnx = @mysql_connect("localhost", "username", "password"); // this user doesn't have access
if (!$dbcnx) {
echo( "<P>No Information for Today!!!</P>" ); //Executed, since it didn't connect
}
if (! @mysql_select_db("MyTable") ) { // Should fail, since it didn't connect
echo( "<P>Unable to locate the " .
"database at this time.</P>" );
}
$sql = 'SELECT * MyTable';
$result = mysql_query($sql);
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
}
$htoutput = "<table>".
"<tr>".
"<td><b>Item 1</b></td>".
"<td><b>Item 2</b></td>".
"<td><b>Item 3</b></td>".
"</tr>";
echo($htoutput);
$i=0;
while ( ($row = mysql_fetch_array($result)) and ($i<5) ) {
// process the row...
$htoutput = "<tr>".
"<td>" . $row["Item1"] . "</td>".
"<td>" . $row["Item2"] . "</td>".
"<td>" . $row["Item3"] . "</td>".
"</tr>";
echo($htoutput);
$i = $i + 1;
}
echo("</table>");
echo("<p>Updated daily at 7:00 pm Eastern</p>");