Jump to content

newlines not showing up when info previously stored in DB is displayed on page


newbeee

Recommended Posts

the news field in my database is a text type

 

what i wish to know is how to have text that has line breaks within the text

still show with these line breaks when i grab the data again to show it in the page it is ment for.

 

at the moment all the text seems to just continue on one long line and breaks up when the end of the page is reached.

 

edit file

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?
include("config.php");

if($_POST['submit'] == "submit") {
$update = mysql_query("UPDATE `news` SET `news` = '" . $_POST['news'] . "'");
} else {
$news = mysql_query("SELECT * FROM `news`");
?>
<textarea name="news" cols="80" rows="10"><?=@mysql_result($news, 0, 'news');?></textarea><br>
<input name="submit" type="submit" value="submit">
<?
}
?>
</body>
</html>

 

display page

<?=@mysql_result($mpsurgeries_news, 0, "mpsurgeries_news");?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.