Hi
I am having a problem and I can not work out how to solve this.
I have one page that inserts text into a mysql table.If I look in mysql front, I can see the data and it shows the paragraphs. However when I call the data to show on a new page, the paragraphs disapear.
If I had inserted the above 2 paragraphs it would show as follows: I am having a problem and I can not work out how to solve this.I have one page that inserts text into a mysql table.If I look in mysql front, I can see the data and it shows the paragraphs. However when I call the data to show on a new page, the paragraphs disapear.
Does anyone know how I can sovle this. Below is the code. Thanks in advance for any help.
######## insert file #####################
<?php
if(isset($_POST['submitted'])) {
if(!empty($_POST['content'])) {
$content =trim($_POST['content']);
} else {
echo "Enter some text please.";
}
if($content) {
$query="insert into data (content) values ('$content')";
$result=mysql_query($query);
}
echo $query;
if(mysql_affected_rows == 1) {
echo "Added";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="insert_data.php" method="post">
<textarea name="content" rows="5" cols="40"></textarea>
<input type="submit" name="submit" value="Add" />
<input type="hidden" name="submitted" value="true" />
</form>
</body>
</html>
######### display file ###########################
<?php
$query = "select * from data limit 1";
$result = mysql_query($query);
$row=mysql_fetch_row($result);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div>
<?php
echo $row[1];
?>
</div>
</body>
</html>
Any help would be appreciated ... thank you
I am having a problem and I can not work out how to solve this.
I have one page that inserts text into a mysql table.If I look in mysql front, I can see the data and it shows the paragraphs. However when I call the data to show on a new page, the paragraphs disapear.
If I had inserted the above 2 paragraphs it would show as follows: I am having a problem and I can not work out how to solve this.I have one page that inserts text into a mysql table.If I look in mysql front, I can see the data and it shows the paragraphs. However when I call the data to show on a new page, the paragraphs disapear.
Does anyone know how I can sovle this. Below is the code. Thanks in advance for any help.
######## insert file #####################
<?php
if(isset($_POST['submitted'])) {
if(!empty($_POST['content'])) {
$content =trim($_POST['content']);
} else {
echo "Enter some text please.";
}
if($content) {
$query="insert into data (content) values ('$content')";
$result=mysql_query($query);
}
echo $query;
if(mysql_affected_rows == 1) {
echo "Added";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="insert_data.php" method="post">
<textarea name="content" rows="5" cols="40"></textarea>
<input type="submit" name="submit" value="Add" />
<input type="hidden" name="submitted" value="true" />
</form>
</body>
</html>
######### display file ###########################
<?php
$query = "select * from data limit 1";
$result = mysql_query($query);
$row=mysql_fetch_row($result);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<html xmlns="<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<div>
<?php
echo $row[1];
?>
</div>
</body>
</html>
Any help would be appreciated ... thank you