I keep getting
Server error
The website encountered an error while retrieving https://www.website.com/update.php?FName=asdd&PHONE=4444444444. It may be down for maintenance or configured incorrectly.
<?php
$FName = $_POST['FName'];
$LName = $_POST['LName'];
$PHON = $_POST['PHON'];
//connect
$dbh=mysql_connect ("localhost", "username", "password") or die ('ERROR!');
mysql_select_db ("user_Client");
$query = "INSERT INTO ClientTable (ID, FName, LName, PHON) VALUES
('NULL','".$FName."','".$LName."','".$PHON."')";
mysql_query($query) or die ('Error updating Daatabase');
echo "Database Update with:" .$FName. " " .$LName. " " .$PHON. ;
?>
I don't know what's the problem here. I followed instructions from here http://teamtutorials.com/web-development-tutorials/php-tutorials/inserting-data-into-a-mysql-database-using-php#.UEiSQY3iajk If it helps - I'm using cPanel from Josthost.
Here is the form:
<html>
<head>
<title></title>
</head>
<body>
<form method="post" action="update.php">
First Name:<br/>
<input type="text" name="FName" size="30" /><br/>
Last Name:<br/>
<input type="text" name="LName" size="30" /><br/>
Phone:<br/>
<input type="text" name="PHON" size="12" /><br/>
<input type="submit" value="Update Database"/>
</form>
</body>
</html>
mysql_*functions for new code. They are no longer maintained and the community has begun the deprecation process. See the red box? Instead you should learn about prepared statements and use either PDO or MySQLi. If you can't decide, try this article. If you care to learn, here is good PDO tutorial.$FNLameand trying to use$LNameother places. Lots of other errors too though...