Quantcast
Channel: Joomla! Forum - community, help and support
Viewing all articles
Browse latest Browse all 1047

Joomla! 5.x Coding • Query and display text containing apostrophe

$
0
0
I have a form that includes a comment field. If a user types in a comment that contains an apostrophe, $db->quote works perfectly and saves the entire comment via a Mysql INSERT. However when I SELECT the field later to display as part of an Edit form, I only get the text prior to the apostrophe displayed in my form. What is the correct method to query and display the complete text?

Query to Select the data:
SELECT score, comment FROM #__scores WHERE .... (will only return 1 row)

Query results are accessed via :
$results = $db-loadRow();
$score = $results[0];
$comment = $results[1];

Results are displayed via:
echo "<tr><td colspan=5><input type='text' size=130 name='user_comment' value='".$comment."'></td></tr>";

Statistics: Posted by pcsadmin — Mon Oct 14, 2024 11:50 pm



Viewing all articles
Browse latest Browse all 1047

Trending Articles