MySQL Forums
Forum List  »  General

Problems with a INSERT of a textarea
Posted by: Rafael Muller
Date: November 16, 2004 11:28PM

Hi:

I have a problem that has me stumped as to a solution. The issue has to do with a textarea content that I am trying to insert into a mysql table. I am using a editor (wysiwygpro) to get the information to plug it back into the database ( it is a case management app ).

For some reason sometimes the data is accepted, I can see if across the PHP script before and after the mysql insert statement. But it doesn't get inserted into the database. It seems to be more prevalent if I copy/paste text from a webpage ( like below). I activated the mysql log file and see the following:

041116 23:54:20 803 Connect vnt_cap@localhost on
803 Init DB vnt_cap
803 Query INSERT into vnt_cap_notes_table (vnt_case_id, vnt_case_notes, vnt_case_note_author, vnt_case_note_date)
VALUES ('1',`<p>What made the South Dakota election important was Daschle ? his personal power in the Senate. The state itself has never been a bellwether, such that its voters' dispositions can reasonably be said to reflect broad national trends. Even if they could, moreover, Daschle came very close to winning, and his loss was much less about any single issue than about the overall impression that he had for too long pulled the wool over South Dakotans' eyes ? pretending at home to be a bridge-builder with a conservative streak, while actually operating in Washington as a fierce partisan of the Democratic Left.</p> Concurrently, Kirkpatrick's theory omits consideration of a central concern: money. Nationally, Democrats are in the thrall of trial lawyers, civil-liberties activists, and the pro-choice lobby. These interest groups are no dummies ? they fully appreciate that much of what they want to bring about as policy (<em>e.g.</em>, abortion-on-demand, affirmative action, according constitutional protections to foreign enemy combatants) is unpopular with voters, while much of what is popular with voters (<em>e.g.</em>, tort-reform) is anathema to them. They are reliant on activist judges willing to stretch the Constitution as a sheath that gives their preferences the cover of "fundamental law," insulating them from challenge at the ballot box. For them, then, there is no issue in national politics more crucial than the composition of the federal bench. It is, bluntly, the whole <p>&nbsp;</p>`,'','2004-11-16 23:54')
803 Quit

But this is NOT inserted into the database. When I look via phpMyAdmin I don't see it in the table either. I have used both the single quote and backquote with no luck.

I thought it orginally had to do with special characters ( in particular \n ) but I removed those also with the following before inserting into the database:

$_POST['casenote'] = str_replace(chr(10), " ", $_POST['casenote']);
$_POST['casenote'] = str_replace(chr(13), " ", $_POST['casenote']);

But that didn't do anything either. Here is the insert:

mysql_query("INSERT into vnt_cap_notes_table (vnt_case_id, vnt_case_notes, vnt_case_note_author, vnt_case_note_date)
VALUES ('".$_POST['selectedCase']."',`".$_POST['casenote']."`,'".$_POST['author']."','$time')",
$sql_database_connection);

I have to believe I am doing something really dumb. But I have looked everywhere on the web and I can't find anything of people seing a similar problem.

Any help would be appreciated.
Thanks!
Raf

Options: ReplyQuote


Subject
Written By
Posted
Problems with a INSERT of a textarea
November 16, 2004 11:28PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.