Jump to content

I have entered two values but only one is being added to the mysql


xxreenaxx1

Recommended Posts

Hey guy

 

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

mysql_select_db("Examination", $con);

$sql="INSERT INTO Test (Tes_Name, Tes_Description)
VALUES
('$_POST[Tes_Name]','$_POST[Tes_Description]')";

if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";

mysql_close($con)
?> 

 

This is my code and I can enter Tes_Name on to mysql but nothing is shown for Tes_Description.

 

The form is

 

<html>

    <body>

<h3>Test</h3>

<table border="0">
<form method="POST" action="try2.php">
<tr><td>Tes_Name</td><td>:</td><td><input type="text" name="Tes_Name" size="20"></td></tr>
<tr><td>Tes_Description</td><td>:</td><td><input type="Tes_Description" name="password" size="20"></td></tr>
<tr><td> </td><td> </td><td><input type="submit" value="Submit"></td></tr>
</form>
</table>

</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.