I want to insert textbox values to Mysql. i'm using cPanel server here. I have read some articles and I've come up to this code. but it's not inserting to the database. i'm sure about the connection has been established. what am i doing wrong here? any help? here the code please feel free to edit it.
if (!empty($name) || !empty($email) || !empty($office_id) || !empty($title) || !empty($story)) {
$save_sql = "INSERT INTO `tbl_story` (filename, name, email, office_id, title, story) VALUES ('$img_newname','$name','$email','$office_id','$title','$story')";
$query = mysql_query($save_sql,$con) or die(mysql_error("Could not write information to the database"));
if (mysql_affected_rows($con) == 0) {
echo 'Your story was not created.';
} else {
echo 'Your story was created successfully';
} }