I have a simple form passing varibles to write to a db. It write some of the var and not others
Here is the form
<form method="POST" action="report.php">
<div align="left">
<input type="hidden" name="fldparent" value="0">
<table>
<tr>
<td width="121"><font face="Arial, Helvetica, sans-serif" size="2">Name:</font></td>
<td width="264"> <input type="text" name="poster"> </td>
</tr>
<tr>
<td width="121"><font face="Arial, Helvetica, sans-serif" size="2">Email
Address:</font></td>
<td width="264"> <input type="text" name="email"> </td>
</tr>
<tr>
<td width="121"><font face="Arial, Helvetica, sans-serif" size="2">Message
Title:</font></td>
<td width="264"> <input type="text" name="subject"> </td>
</tr>
<tr>
<td valign=top width="121"><p> </p>
<p> </p>
<p><font face="Arial, Helvetica, sans-serif" size="2">Message:</font></p></td>
<td width="264"> <textarea wrap="virtual" name="report" cols=40 rows=10></textarea>
</td>
</tr>
</table>
<p><br>
<input name="Submit" type="image" src="/images/post.gif" width="100" height="20" border="0">
here is the php page to write to database
<?php
$thedate = date("F d, Y");
$Host = "localhost";
$User = "user";
$Password = "passwd";
$DBName = "dbname";
$TableName = "tblreports";
$Link = mysql_connect ($Host, $User, $Password) or die ("The database connection could not be established!");
$query = "SELECT MAX(fldthread) as threads from tblreports";
$Result = mysql_db_query ($DBName, $query, $Link);
while ($Row = mysql_fetch_array($Result)) {
$x = 1;
$y = $x + $Row[threads];
$query1 = "INSERT INTO $TableName (id,fldparent,fldthread,fldname,fldemail,fldtitle,fldbody,flddate)
values ('0','$fldparent','$y','$poster','$email','$subject','$report','$thedate')";
The query runs fine but i did a print of the query and this is what it returns
INSERT INTO tblreports (id,fldparent,fldthread,fldname,fldemail,fldtitle,fldbody,flddate) values ('0','','1','','','','','February 26, 2003')
Please help Why is this not writing the values to the db