Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Connected - Input Does Not Populate Table

$
0
0

Hello.

 

I have been working at this for quite awhile now.

 

It is a rebuild of a successful DB from years ago (But I no longer have access to that code which is on a disabled machine).

 

Simply put, I am able to connect (No errors thrown), but no matter what I try I cannot post simple text to the table. I'm not sure why.

<html>
<body>

<form action="simpleTable3.html" method="post">
Firstname: <input type="text" name="fname" /><br><br>
Lastname: <input type="text" name="lname" /><br><br>
 
<input type="submit" />
</form>
 
<?php
$con = mysql_connect("sql2**.******.***","b8_14160309_simpleDB3","b8_14160309","c*******");
if (!$con)
  {
  die('Could not connect:' . mysql_error());
  }
 
mysql_select_db("b8_14160309_simpleDB3", $con);
 
$sql="INSERT INTO simpleTable3 (fname, lname)
VALUES
('$_POST[fname]','$_POST[lname]')";
 
if (!mysql_query($sql,$con))
  {
  die('Error: ' . mysql_error());
  }
echo "1 record added";
 

?>
</body>
</html>

So, I need some assistance. Please. A hint or pointer in the right direction.

 

Thank you in advance!

 

The_Thorn

 


Viewing all articles
Browse latest Browse all 13200

Trending Articles