# Problem inserting record pls help

**URL:** <https://forum.kirupa.com/t/problem-inserting-record-pls-help/266992>\
**Category:** programming\
**Created:** [July 27, 2008, 1:05am UTC](https://forum.kirupa.com/t/problem-inserting-record-pls-help/266992 "2008-07-27T01:05:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![atplerry](https://avatars.discourse-cdn.com/v4/letter/a/f08c70/32.png) [@atplerry](https://forum.kirupa.com/u/atplerry)\
**Post date:** [July 27, 2008, 1:05am UTC](https://forum.kirupa.com/t/problem-inserting-record-pls-help/266992/1 "2008-07-27T01:05:11Z")

</div>

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–\>

```
  &lt;tr&gt;
    &lt;td width="3" height="1"&gt;&lt;/td&gt;
      &lt;td width="184"&gt;&lt;/td&gt;
      &lt;td width="336" rowspan="11" valign="top"&gt;&lt;form id="form1" name="form1" method="post" action="reg_forminsert.php"&gt;
          &lt;input type="text" name="Username" /&gt;
          &lt;br /&gt;
          &lt;input type="text" name="Password" /&gt;
          &lt;br /&gt;
          &lt;input type="text" name="Confirmpass" /&gt;
          &lt;br /&gt;
          &lt;input type="text" name="Name" /&gt;
          &lt;br /&gt;
          &lt;input type="text" name="Comment" /&gt;
          &lt;input type="submit" name="Submit" value="Submit" /&gt;
          &lt;br /&gt;
      &lt;/form&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="19"&gt;&lt;/td&gt;
      &lt;td valign="top"&gt;Username&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="4"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td height="19"&gt;&lt;/td&gt;
      &lt;td valign="top"&gt;Password&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="4"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  
  
  &lt;tr&gt;
    &lt;td height="19"&gt;&lt;/td&gt;
      &lt;td valign="top"&gt;Confirm Password &lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="4"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  
  
  
  
  
  
  &lt;tr&gt;
    &lt;td height="19"&gt;&lt;/td&gt;
      &lt;td valign="top"&gt;Name&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="2"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td height="19"&gt;&lt;/td&gt;
      &lt;td valign="top"&gt;Comment&lt;/td&gt;
    &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td height="2"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  &lt;tr&gt;
    &lt;td height="44"&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
      &lt;td&gt;&lt;/td&gt;
    &lt;/tr&gt;
  
  
  
&lt;/table&gt;

```

**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);

---

<div class="post-metadata">

**Author:** ![Syous](https://avatars.discourse-cdn.com/v4/letter/s/57b2e6/32.png) [@Syous](https://forum.kirupa.com/u/Syous)\
**Post date:** [July 27, 2008, 12:52pm UTC](https://forum.kirupa.com/t/problem-inserting-record-pls-help/266992/2 "2008-07-27T12:52:08Z")

</div>

Confirm\_pass and $Confirmpass aren’t the same, but I don’t think that’d be the issue.
