greeting....
As of now i'm in the middle of developing our website which is my thesis.,., about the blogs of the said study.,., I have a problem with this *censored* textarea for my blog.,.,
the database:
CREATE TABLE ‘blogs’ (
`blogs_id` int(10) unsigned NOT NULL auto_increment,
`blogger` varchar(15) NOT NULL,
`blog_topic` varchar(75) NOT NULL,
`blog_content` text NOT NULL,
`date_created` varchar(20) NOT NULL,
PRIMARY KEY (`blogs_id`),
) ;
the code:
<?php
$host = "localhost";
$user = "root";
$passwd = "*******";
$database = "cssonlinedb";
$connect_db = mysql_connect("$host","$user","$passwd");
if (!$connect_db) {
die ('Could not Connect: ' . mysql_error() );
}
mysql_select_db("$database", $connect_db) or die ('Cant connect the database: ' . mysql_error() );
$id = $_GET['IDuser'];
$topic = $_POST['blog_title'];/textarea for subject
$content = $_POST['blog_content'];//textarea for content
$date_time = date("m/d/y h:i:s");
// Get first the name of the blogger
$blogger = "SELECT username FROM css_registration WHERE memID = '$id';";
$blogger_test = mysql_query($blogger);
if ( !$blogger_test ) {
die ("ERROR: " . mysql_error() );
}
else {
$blogger_field = mysql_fetch_array($blogger_test);
$blogger = $blogger_field['username'];
// add the information in the database
$sql = "INSERT INTO blogs ( blogger, blog_topic, blog_content, date_created )
VALUES ( '$blogger', '$topic', '$content', '$date_time');";
$test = mysql_query($sql);
if ( !$test ) {
die ('ERROR: ' . mysql_error() );
}
else {
echo cool;
}
}
mysql_close();
?>
the input
What's a blog?
A blog is a personal diary. A daily pulpit. A collaborative space. A political soapbox. A breaking-news outlet. A collection of links. Your own private thoughts. Memos to the world.
Your blog is whatever you want it to be. There are millions of them, in all shapes and sizes, and there are no real rules.
In simple terms, a blog is a web site, where you write stuff on an ongoing basis. New stuff shows up at the top, so your visitors can read what's new. Then they comment on it or link to it or email you. Or not.
Since Blogger was launched in 1999, blogs have reshaped the web, impacted politics, shaken up journalism, and enabled millions of people to have a voice and connect with others.
And we're pretty sure the whole deal is just getting started.
:
the error:
ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's new. Then they comment on it or link to it or email you. Or not. Since Blogge' at line 2
// this code really freaks me out.,.,. and i know that the datatype text has a maximum length of 65535 characters. is it in the textarea?
thanks.....
reynz