ode to put entries into a database.
However when I test it I just get a blank page????
Why is this???
Please could you help me.
Thank you.
Here is my php code...
<?php
// create short variablle names
$null = $HTTP_POST_VARS['null'];
$const = $HTTP_POST_VARS['const'];
$name = $HTTP_POST_VARS['name'];
$email = $HTTP_POST_VARS['email'];
$party =$HTTP_POST_VARS['party'];
if (!$null || !$const || !$name || !$email || !party)
{
echo 'You have not entered all the details.<br>
<a href="candidate.htm">Return to fill in details</a>';
exit;
}
$null = addslashes($null);
$const = addslashes($const);
$name = addslashes($name);
$email = addslashes($email);
$party = addslashes($party);
@$db = mysql_pconnect('localhost', 'root', 'ballY22');
if (!$db)
{
echo 'Error: Unable to connect to database';
exit;
}
mysql_select_db('trial');
$query = "insert into candidate values
('".$null."', '".$const."', '".$name."', '".$email."', '".$party."')";
$result = mysql_query($query)
if ($result)
echo mysql_affected_rows().' details inserted into database.';
?>