so here is what i have so far....
I created a database with phpmyadmin called "boarhunt" and a table named "news" with two fields these are set like so..
1. id, int, (11), not null, primary key.
2.content, text, not null, default.
So it looks like this...
http://img521.imageshack.us/img521/2966/dbshotdi1.jpg
For my form page i have tinymce setup with the form action set to post to postnews.php like so...
Code: Select all
<form action="postnews.php" method="post">
<div id="elm1" style="width:450px; height:250px">
</div>
<input type="submit" value="Submit">
</form>Here is my code for the postnews.php file...
Code: Select all
<?
$username="******";
$password="******";
$database="boarhunt";
$host="localhost";
if(isset($_POST['save']))
$content=$_POST['content'];
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
{
$query = "insert into News (id,content) values ('','$content')";
mysql_query($query) or die(mysql_error('Error Query Failed'));
echo htmlspecialchars($query);
}
mysql_close();
?>and it increases in size so i assume that part is working, but if there is anything odd about it please let me know?
Next (and this is where i have hit a brick wall) i have tried to write an output script to go on my public pages to display the edited content
but all i get back is a bunch of numbers.
here is the script for my public page...
Code: Select all
<?
$host="localhost";
$username="******";
$password="******";
$database="boarhunt";
$db = mysql_connect($host,$username,$password);
@mysql_select_db($database) or die("Unable to select database");
$result = mysql_query("SELECT * FROM news");
while($row = mysql_fetch_array($result))
{
echo $row['id'] . " " . $row['content'];
}
@mysql_close($db);
?>http://img399.imageshack.us/img399/8571 ... putgo0.jpg
So what i would like to know is how do i get the page to display the content i entered into the wysiwyg editor instead of those numbers?
And where am i going wrong with my script?
Many thanks in advance to anybody who can help me out with this as i have been scratching my head over this for a week now and i have gotten as far as i can on my own with this.