Pls i dont relly want to understand what is really wrong with the code below!
I want to insert record into the database i have written one and it is working well for two record but for these is not working. And more so it work anytime it like it there anything that i am doing wrong cos sometime one record may be blank and the other fill in or vise versa
I collect the data from a form
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="3" height="1"></td>
<td width="184"></td>
<td width="336" rowspan="11" valign="top"><form id="form1" name="form1" method="post" action="reg_forminsert.php">
<input type="text" name="Username" />
<br />
<input type="text" name="Password" />
<br />
<input type="text" name="Confirmpass" />
<br />
<input type="text" name="Name" />
<br />
<input type="text" name="Comment" />
<input type="submit" name="Submit" value="Submit" />
<br />
</form></td>
</tr>
<tr>
<td height="19"></td>
<td valign="top">Username</td>
</tr>
<tr>
<td height="4"></td>
<td></td>
</tr>
<tr>
<td height="19"></td>
<td valign="top">Password</td>
</tr>
<tr>
<td height="4"></td>
<td></td>
</tr>
<tr>
<td height="19"></td>
<td valign="top">Confirm Password </td>
</tr>
<tr>
<td height="4"></td>
<td></td>
</tr>
<tr>
<td height="19"></td>
<td valign="top">Name</td>
</tr>
<tr>
<td height="2"></td>
<td></td>
</tr>
<tr>
<td height="19"></td>
<td valign="top">Comment</td>
</tr>
<tr>
<td height="2"></td>
<td></td>
</tr>
<tr>
<td height="44"></td>
<td></td>
<td></td>
</tr>
</table>
reg_forminser.php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("forum", $con);
echo "connection successful";
mysql_query("INSERT INTO 'forum'.'reg_info' (Username,Password,Comfirm_pass,Name,Comment)
VALUES ('$Username', '$Password', '$Confirmpass', '$Name', '$Comment')");
echo "Record Inserted";
mysql_close($con);