Jump to content

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


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>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.