Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP/MYSQL table problems

Status
Not open for further replies.

bvrtrimmer

Programmer
Jul 31, 2000
2
0
0
US
Hi I have the following table (real simple): <br><br>CREATE TABLE txttest (comments TEXT); <br><br>I then use a &lt;textarea&gt; to type in my comment.<br>This text then gets inserted into the table above. <br><br>I was told to use: <br>$comments=urlencode($comments); <br>before inserting into my database<br>&nbsp;<br>This WORKS when I type in something like: <br>&quot;this is a comment line&quot; <br>(looks like: this+is+a+comment+line)<br>&nbsp;<br>BUT if I type in something like: <br>&quot;this is a comment line, <br>this is another comment line&quot;<br>&nbsp;<br>(looks like: this+is+a+comment+line%2C%0D%0Athis+is+another+comment+line) <br><br>I get this error: <br>Error in executing INSERT INTO txttest (comments)<br>VALUES('this+is+a+comment+line%2C%0D%0Athis+is+another+comment+line') <br>error:1065 Query was empty <br><br>ANY IDEAS?? <br><br>Thanks <br>Mike
 
I believe when you urlencode, you also need to use addslashes($encoded_data) before entering into database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top