R
Raptor753
Guest
I'm trying to write to a mySQL database from PHP but, its not working.
I don't get an error message, but the database never get the new information. I'm sure that I'm connecting to the database correctly but, I cant update the information inside "content" in the table "main".
Code:
if(isset($_POST['saveFirst'])){
$mysql_host = "mysql4.000webhost.com";
$mysql_database = "a2954451_db";
$mysql_user = "a2954451_root";
$mysql_password = "Raptor.753!";
mysql_connect($mysql_host,$mysql_user,$mysql_password) or die("Unable to connect to database");
//$mysql = new mysqli($mysql_host, $mysql_user, $mysql_password, $mysql_database)or die('You\'re Dead');
$textData = $_POST['first'];
$sqlquery = "INSERT INTO main('content') VALUES('$id','$textData')";
mysql_query($sqlquery);
mysql_close();
header('Location:http:../index.php');
}
Thanks
I don't get an error message, but the database never get the new information. I'm sure that I'm connecting to the database correctly but, I cant update the information inside "content" in the table "main".
Code:
if(isset($_POST['saveFirst'])){
$mysql_host = "mysql4.000webhost.com";
$mysql_database = "a2954451_db";
$mysql_user = "a2954451_root";
$mysql_password = "Raptor.753!";
mysql_connect($mysql_host,$mysql_user,$mysql_password) or die("Unable to connect to database");
//$mysql = new mysqli($mysql_host, $mysql_user, $mysql_password, $mysql_database)or die('You\'re Dead');
$textData = $_POST['first'];
$sqlquery = "INSERT INTO main('content') VALUES('$id','$textData')";
mysql_query($sqlquery);
mysql_close();
header('Location:http:../index.php');
}
Thanks