Location: PHPKode > projects > Web-Based Election Software > e-admin/deletecandidates.php
<?php
ini_set('display_errors', 1);
ini_set('display_warnings', 1);
include('loggedincheck.php');

// connect to db server.
include('../includes/dbconnection.php');

$sql = "TRUNCATE TABLE `candidates`";

$sqlresult = mysql_query($sql);
if (!$sqlresult) {
    die('Invalid query: ' . mysql_error());
}

$sql = "INSERT INTO `candidates` (`rowid` ,`lastname` ,`firstname` ,`position` ,`blurb`) VALUES (NULL , 'No Confidence', '', 'No Confidence', '')";
$sqlresult = mysql_query($sql);
if (!$sqlresult) {
    die('Invalid query: ' . mysql_error());
}

header("location:index.php#resetdata");

?>
Return current item: Web-Based Election Software