Hi, I have this query to add data to mysql

$query = "INSERT INTO products VALUES('', '$acode', '$aname', '$acontent', '$aprice', '$remote_file', '$cat')";

My table is
id int(20) primary ai
code varchar(200)
product_name varch(200)
description varchar(600)
price decimal(10, 2)
imagepath varchar(200)
product_id int(10)

I have an html textarea to enter data for the description field. When the text in the textarea is, say, 250characterslong, everything is fine-the query works and all data is added to mysql. But when the text is say 500 long the the query does not work and nothing is added.

Can anyone help?

Thanks for looking

Glen...

Thats still not working. It adds nothing. But if the text description is short the it adds to the database ok.

Any ideas?

Member Avatar for diafol

OK, could it be due to unescaped characters? You're using mysql_real_escape_string() right?

mysql_real_escape_string()

I wasnt using this, but using it now has sorted the problem!

Thank you!

Glen..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.