My PHP form is writing a blank row in my MYSQL database.
Here is my code. What am I doing wrong? I am frustrated at this point. When I hit submit, it's creating the row within the database, but there is no data.
<?php
$servername = "localhost";
$username = "blah";
$password = "blah2";
$database = "blah3";
$vdesc = $_POST['desc'];
$vproductname = $_POST['productname'];
$vproductver = $_POST['productver'];
$vtypeofhard = $_POST['typeofhard'];
$vosname = $_POST['osname'];
$vfreqofocc = $_POST['freqofocc'];
$vsolution = $_POST['solution'];
mysql_connect($servername,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO recordofbugs VALUES('','$vdesc','$vproductname','$vproductver',
'$vtypeofhard','$vosname','$vfreqofocc','$vsolution')";
mysql_query($query);
mysql_close();
?>
<!DOCTYPE html>
<head>
<link rel="stylesheet" type="text/css" href="buglistcss.css">
<title>Bug List</title>
</head>
<body>
<h1>Bug List</h1>
<?php $servername = "localhost";
$username = "blah";
$password = "blah1";
$database = "blah2";
mysql_connect($servername,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM recordofbugs";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();?>
<div id="data">
<table border="0" cellspacing="2" cellpadding="2">
<tr>
<td>
<font face="Arial, Helvetica, sans-serif">Description | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Product Name | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Product Version | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Type of Hardware | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Operating system | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Frequency of Occurence | </font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif">Proposed Solution</font>
</td>
</td>
</tr>
<?php $i=0;while ($i < $num) {$f1=mysql_result($result,$i,"desc");
$f2=mysql_result($result,$i,"productname");$f3=mysql_result($result,$i,"productver");
$f4=mysql_result($result,$i,"typeofhard");$f5=mysql_result($result,$i,"osname");$f6=mysql_result($result,$i,"freqofocc");$f7=mysql_result($result,$i,"solution");?>
<tr>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f1; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f2; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f3; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f4; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f5; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f6; ?></font>
</td>
<td>
<font face="Arial, Helvetica, sans-serif"><?php echo $f7; ?></font>
</td>
</tr>
</table>
<?php $i++;}?>
</div>
<h1>New Bug Report</h1><br>
<form action="buglist.php" method="post">
<p>
(*)Bug Description: <input class="field" type="text" name="desc"><br>
(*)Product Name: <input class="field" type="text" name="productname"><br>
(*)Product Version: <input class="field" type="text" name="productver"><br>
Type of Hardware: <input class="field" type="text" name="typeofhard"><br>
Operating System: <input class="field" type="text" name="osname"><br>
Frequency of occurence: <input class="field" type="text" name="freqofocc"><br>
Proposed Solution: <input class="field" type="text" name="solution"><br><br>
<input class="submit" type="submit" name="formSubmit" value="Submit">
</p>
</form>
</body>
</html>