//Hi mikeoabban please try the following code, see some reference trough the link
http://www.phpeasystep.com/mysql/5.html[
^]
$hostname='localhost:3306';
$username='root';
$password='';
try {
$dbh = new PDO("mysql:host=$hostname;dbname=forms1",$username,$password);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo 'Connected to Database<br />';
$value = $_POST['input1'];
$sql = "INSERT INTO demo (input1) VALUES ('$value')";
$result=mysql_query($sql);
if($result){
echo "Successful";
}else{
echo $sql;
}
$dbh = null;
}
catch(PDOException $e)
{
echo $e->getMessage();
}
?>