rendered paste body try(); {
$q= $conn->insert('
into blog (
timestamp,
title,
entry,
author,
branch_id
)
values
(
%s, -- timestamp
%s, -- title
%s, -- entry
%s, -- author
%s -- branch_id
)',
$timestamp,
$title,
$entry,
$author,
$branch_id
);
}
if (catch('SQLException', $e)) {
echo "<table border=0 align=center width=100%>
<tr>
<td>";
echo "<label><font color=red><b>ERRORS OCCURED...</label></font></b>";
echo "<hr>";
echo "<br>";
echo "<label><img src=common/img/icons/i_error.gif border=0 align=absmiddle> Fill out the entire fields<br>
";
echo "Check for Duplicate Entry";
echo "<br>";
echo $e->getMessage();
echo "<br>";
echo "</td>
<td>";
}
else
{
echo "<table border=0 align=center width=100%>
<tr>
<td>";
echo "<label>OK <img src=common/img/icons/ok-small.png></label>";
echo "<br>";
echo $title; echo" "; echo "Posted by:"; echo" "; echo $author;
echo "<br>";
echo "<label>News has successfully been added to database.";
echo "<br>";
echo "</td> <td>";
}