Forum Settings
       
Reply To Thread

formatting and MySQLFollow

#1 Jan 13 2004 at 3:55 PM Rating: Good
**
546 posts
hopefully Kao or Illia can answer this:

how do i make it so i dont lose my formatting when moving from an <input> box to a mysql table and then back out for displaying

i.e.
1
2
3
4
5

would look like this

12345

how would i keep the returns automagically ?
#2 Jan 14 2004 at 5:32 AM Rating: Excellent
Avatar
******
29,919 posts
Are each of the numbers a seperate database item? or is that all 1 field that you want showing up like that in the table cell?
#3 Jan 14 2004 at 9:04 AM Rating: Good
**
546 posts
1 field

it doesnt have to look like that in the cell per se but it does when i retrieve it
#4 Jan 15 2004 at 10:14 AM Rating: Good
**
546 posts
if ( $action == "read" ) {
$message=$_GET['num'];
mysql_connect('localhost',$usersql,$passsql);
@mysql_select_db(centmtg_db3) or die( "Unable to select database");
$query="SELECT * FROM pms_messages WHERE id = '$message' LIMIT 1";
$result=mysql_query($query) or die(mysql_error());
$to=mysql_result($result,0,"recipient");
$sender=mysql_result($result,0,"sender");
$subject=mysql_result($result,0,"subject");
$date=mysql_result($result,0,"date");
$new=mysql_result($result,0,"unread");
$body=mysql_result($result,0,"body");
$date = date(" n-j-y g:ia", $date);
$body=nl2br($body);
if ( $to == $_SESSION['email'] ) {
require("include/menubar.php");
$query2="UPDATE pms_messages SET unread = 'FALSE' WHERE id = '$message'";
$result2=mysql_query($query2) or die(mysql_error());
print " <table width=\"400\">
<tr class=\"odd\"><a href=\"http://www.centmtg.net/message.php?id=inbox\">Inbox</a>
&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
<a href=\"http://www.centmtg.net/message.php?id=compose\">Compose</a>
<tr class=\"odd\"><strong>From:</strong> ".$sender."</tr>
<tr class=\"odd\"><strong>Date:</strong> ".$date."</tr>
<tr class=\"odd\"><strong>Subject:</strong> ".$subject."</tr>
<tr class=\"odd\"><strong>Message</strong><br /></tr>
$body<br />";
}
}


$body=nl2br($body); <---- fixed the problem

Edited, Thu Jan 15 10:15:34 2004 by Murth
Reply To Thread

Colors Smileys Quote OriginalQuote Checked Help

 

Recent Visitors: 3 All times are in CST
Anonymous Guests (3)