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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/ Data base!

Status
Not open for further replies.

NEL3644

Technical User
Sep 4, 2000
26
US
The field Comment in my User table the Data looks like the folowing:

Comment
==================
point 5 "excelent"
point 4 "very goood"
point 3 "good"
point 2 "fair"
point 1 "poor"

The problem I'm having is that when I go and get these records out of the DB and display them w/ the <cfoutput>, whatever information that appears within quotes disapears. For example:
point 5
point 4
......

But, if I go to the field Comment and I manually change the records to be like
point 5 &qutexcelent&qut
point 4 &qutvery good&qut
point 3 &qutgood&qut
point 2 &qutfair&qut
point 1 &qutpoor&qut

Note: &qut is the special character equivalent to quotes

My output comes just fine (whatever its in quotes does not desapear) eg.
point 5 &quot;excelent&quot;
point 4 &quot;very goood&quot;....

My question is, how can I display these records (point 5 &quot;excelent&quot;..) without having to go and manually replace quotes (&quot;) w/ the special character (&qut) in the DB?
 
I think this will help you do that a little quicker

UPDATE yourtable
SET rowname = 'point5&qutexcelent&qut'
WHERE rowname = 'point5&quot;excelent&quot;'
 
Thanks for your help, chi1beast!
Now, I have a question regarding the same subject:
I have another field where there a lots of text records that the users entered. The field looks like this:

Comment2
==============================
I like &quot;this product&quot; a lot...
Change the &quot;appearence&quot;....
NO! &quot;Maybe a little bit&quot;....
.
.
.

When I query this records and display on my site so that I can edit them, the output does not display the information whithin quotes!
The results that I get look like these:

I like
Change the
NO!

Is there any way I can avoid this output problem so that I can be able to see and edit all the complete information coming from the DB?
 
I would have to ask what is the data type of the row, maybe you could just make it a text field or char field? Or is your cold fusion not passing the variable of &quot;this product&quot; to the database?
 
The Data Type is TEXT!

The variable is passed to the database just fine including the quotes (&quot;), the problem appears to happen when I get the data out of the database! As I mentioned erlier, the only way the information is displayed w/ no problems on my site is when I go to the database and I manualy replace the quotes w/ the special character for quote (&qut;)...

 
I would set it up so that the user see's the &quot; when filling out the form, but the actual submission to the database use the &qut that way you get the &quot; when you display it on the screen. You can make the vale=&quot;&quot; different from what you display on the screen, and as far as the exsiting entree's uses the update quey we talked about earlier!
 
As far as the existing records in the database, records with (&quot;) not (&qut) that are existent in the database and not yet modified, I don't think the update query will remove the records from the db...This query will only update or replace (&quot;) w/ (&qut) of existing records...What happens if I remove an existing record which has information LOST due to quotes? Then, I don't know what to edit?

The tricky part, I believe, is on selecting the records and displaying them....
Is there any way I can solve this at run time, ie as I select the records from the database OR looping through the result set after the select query is run and as the <cfoutput> is displaying?
 
If you are editing the data, try
<TEXTAREA NAME=&quot;divcontent&quot; rows=&quot;15&quot; cols=&quot;55&quot; WRAP=soft>#HTMLEditFormat(get_data.divcontent)#</TEXTAREA>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top