A blank page is returned when I try to add a new note. My code is in php and the DB is mysql
This is the php code:
if (isset($_POST['Submit'])) {
$candidate_id = $_POST['candidate_id'];
$Notes=$_POST['notes'];
if ($Notes != "") {
$sql3="INSERT INTO notes (notes_id, candidate_id, notes)
VALUES(DEFAULT,'$candidate_id','$Notes')";
$result3=mysql_query($sql3);
if (!$result3)
{
die('Error: ' . mysql_error());
}
echo "</br>1 note added"
}
}
mysql_close();
The code for the form
<div id ="tab3">
<h2> Notes </h2>
<dl><dt>Notes</dt><dd><textarea id="notes" style="width: 80%; height: 150px;" name="notes"></textarea></dd></dl>
<?php echo "<a href =newCandidate.php?id=$contact_id><input style =\"right:2em; bottom:1em;\" type =\"button\" name =\"update\" value =\"Submit\"></a>";
?> </div>