Dear All,
I have one question on how to do the following:
I hv a page that submit message and update to my mysql db.
When user type the following msg:
message1
message2
message3
message4
I am able to store in longtext field in my table. However when I display it out to the page, I get the following:
message1message2message3message4
Any ideas how can I print out exactly as what user input?
Any help is grately appreciated.
Thanks,
Richard
another newbie question need help!
Moderator: General Moderators
-
php.newbie
- Forum Newbie
- Posts: 16
- Joined: Wed Sep 20, 2006 3:28 am
-
php.newbie
- Forum Newbie
- Posts: 16
- Joined: Wed Sep 20, 2006 3:28 am
Hi Jcart,
below is my code:
Any idea how I can do it?
Thanks,
Richard
below is my code:
Code: Select all
function prtcontent($id) {
echo '<table>';
$query = "SELECT * FROM msgtbl where msg_id='" . $id . "'";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) {
echo '<tr>';
echo '<td>';
echo $row->msg_content;
echo '</td>';
echo '</tr>';
}
}Thanks,
Richard
-
php.newbie
- Forum Newbie
- Posts: 16
- Joined: Wed Sep 20, 2006 3:28 am