I am working on a development website which involves users posting their favourite content of their book on to the webpage and all the data gets stored in the database and gets displayed on the website. However whenever i try to post big paragraphs using the form I created and php scripts which processes the form, it doesn't give any error but it doesn't store the values to the database as well. It works okay if the content to process is short. Please help me the code is below. Any suggestions would be appreciated.
<?php
$hostname = "localhost";
$username = "root";
$password = "";
$database = "library";
$conn = mysql_connect($hostname,$username,$password)or die('Cannot connect');
mysql_select_db("library", $conn);
?>
<?php
$title = $_POST['title'];
$author = $_POST['author'];
$content = strval($_POST['content']);
$description = $_POST['description'];
$category = $_POST['category'];
if (isset($title) && !empty($title)){
$sql = "INSERT INTO books(title,author,description,content,category) VALUES('$title','$author','$description','$content','$category')";
mysql_query($sql);
echo 'Successfully Added the book'."<a href='/'><br>Check it out here<a>";
}
else{
echo 'Title is missing';
}
?>
Thanks.