i code this without the delete function, but when i started using it, there's and error.
need help with this code
<?php
$_GET['id'];
$username = "root";
$password = '123456';
$hostname = "localhost";
$db = mysql_connect($localhost, $username, $password)
or die ("Unable to connect to mySQL".mysql_error());
mysql_select_db('mynewdbase');
$del = "DELETE FORM newdbase WHERE id = $id";
$nres = mysql_query("$del);
?>
<HTML>
<BODY>
<form method = "get" action = "act1.php">
Storename: <select name="store">
<option value="">---Select---</option>
<option value="Aling Nena">Aling Nena</option>
<option value="Aling Tentay">Aling Tentay</option>
<option value="Aling Toyang">Aling Toyang</option>
</select>
<br>
Sales <input type = "text" name = "sales"><br>
Date <input type = "text" name = "year" size = "3" value = "<?php echo date('Y'); ?>">
-<input type = "text" name = "month" size = "3" value = "<?php echo date('m'); ?>">
-<input type = "text" name = "day" size = "3" value = "<?php echo date('d'); ?>"><br>
<input type = "submit" name = "submit" value = "Save">
<input type = "reset" name = "clear" value = "Cancel">
</form>
</BODY>
</HTML>
<?php
if (isset($_GET['submit']))
{
$username = "root";
$password = '123456';
$hostname = "localhost";
$db = mysql_connect($localhost, $username, $password)
or die ("Unable to connect to mySQL".mysql_error());
mysql_select_db('mynewdbase');
$store = $_GET['store'];
$sales = $_GET['sales'];
$year = $_GET['year'];
$month = $_GET['month'];
$day = $_GET['day'];
$ans = "INSERT INTO newdbase VALUES ('$store', '$sales', '$year' ,'$month', '$day')";
$result = mysql_query($ans);
if($ans!='')
echo '<br>Saving Successful';
else
echo '<br>Failed'. mysql_error();
$queryshow = "SELECT * FROM newdbase";
$result2 = mysql_query($queryshow);
$c = count($result2);
echo '<table border ="1">';
echo '<th>Storename</th><th>Sales</th><th>Date</th><th></th>';
if ($c>0)
{
while ($a=mysql_fetch_array($result2))
{
echo '<tr>';
echo '<td><a href = "act1.php" ? id = $id></td>;
echo '<td>'. $a['store'] . '</td>';
echo '<td>'. $a['sales'] . '</td>';
echo '<td>'. $a['year'] . '-'.$a['month'].'-'.$a['day'].'</td>';
echo '</tr>';
}
}
echo '</table>';
}
?>