Jump to content

MySQL Error


kumarrana

Recommended Posts

I am writing a blog, but I have been getting same error on my mysql.

My MySQL field types are postid/(int(6)), title/(varchar(200)), category/(varchar(200)), post/(longtext), identification/(int(11)), date_crated/(timestamp).

 

What I noticed is when I have really long post (100 words), I get error like " You have an error in your SQL syntax". Plus my timestamps is giving all zero values. Anybody has any idea what is wrong with my table?

Link to comment
https://forums.phpfreaks.com/topic/84421-mysql-error/
Share on other sites

function dump_in_mysql_post()
	{
	$title = stripslashes($_POST['title']);
	$category = stripslashes($_POST['category']);
	$body = stripslashes($_POST['body']);

	echo $title . "<br>". $category . "<br>" . $body . "<br>";

	$dump_in_mysql_post = "INSERT INTO `post` VALUES('$postid', '$title', '$category', '$body', '$identification', '$date_created')";
	$dump_in_mysql_post = mysql_query($dump_in_mysql_post);
		if(!$dump_in_mysql_post)
		{
			echo "Error on querying post ". "<b> ". mysql_error() . "</b>";
		}
		else
		{
			echo "Title : " . $title . " <br> " ;
			echo "Category: " .  $category . " <br> ";
			echo "Body: " . $body . " <br> ";
			echo "Identification : " . $identification;
			echo "Blog entry has been submitted";
		}

	}

Link to comment
https://forums.phpfreaks.com/topic/84421-mysql-error/#findComment-430041
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.