Computer Hope

Internet & Networking => Web design => Topic started by: r3ynz_t4nz on December 04, 2008, 03:18:52 AM

Title: BIG BUGGZZZZZZ: Textarea
Post by: r3ynz_t4nz on December 04, 2008, 03:18:52 AM
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



Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: r3ynz_t4nz on December 04, 2008, 04:24:55 AM
but if i submit a small amount of information on my blogs or smaller number of characters.,. my code is really okey.,., it only differ when i post bigger number of characters........(informaion[blog-content])
thanks in advance.,., and merry christmas to all
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: kpac on December 04, 2008, 10:13:04 AM
What line does it say the error is on?
Is that the full code above there?

I can spot a few errors but I want to be sure it is the right one.... ;)
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: r3ynz_t4nz on December 04, 2008, 10:54:55 PM
even me cant figure out what line that causes error.,.

all i know is that., if i post few character blog that code is good.,.

does textarea and post have limitation??
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: kpac on December 05, 2008, 02:49:52 AM
Where does it say the error? In you browser?

does textarea and post have limitation??

If the form method is set to POST, then there is no limit on what can be sent.
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: r3ynz_t4nz on December 07, 2008, 05:48:28 PM
yes.,. the error is in the browser.,., and i  use post for this blog.,.,. it only differ on the input.,.,.
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: kpac on December 08, 2008, 10:25:32 AM
Copy and paste the exact error message, as well as the whole PHP file. If you think it's too long, attach it with a .txt extension.
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: r3ynz_t4nz on December 15, 2008, 08:52:55 PM
i cant still figure this errors,.
Title: Re: BIG BUGGZZZZZZ: Textarea
Post by: kpac on December 16, 2008, 09:23:05 AM
Copy and paste the exact error message, as well as the whole PHP file. If you think it's too long, attach it with a .txt extension.