See my last post, I just updated it! Don't forget you need something in the database too before it appears. I hope you didn't delete your content.
You didn't have a table until you ran that query which created it! However, I updated the query to add the 'home' and 'books' values to make your life a little easier.
Just find that table named 'pages' and delete it. Then follow the steps again to recreate it with the new values.
After that's done, if all goes right you should just be able to copy your HTML into the textarea and it should be saved into the database, thus displaying on your webpage
Again, this is the code you need to use once it's deleted. I've highlighted in red the difference from the last table.:
Code:-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jun 09, 2012 at 02:12 AM -- Server version: 5.5.16 -- PHP Version: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- -- Database: `pages` -- -- -------------------------------------------------------- -- -- Table structure for table `pages` -- CREATE TABLE IF NOT EXISTS `pages` ( `page` varchar(20) NOT NULL, `content` varchar(10000) NOT NULL, PRIMARY KEY (`page`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `pages` -- INSERT INTO `pages` (`page`, `content`) VALUES ('books', ''), ('home', ''); /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Last edited by dan-dan; 06-09-2012 at 01:34 AM.
What's the difference between the "Edit" and "Submit" buttons? Here's what I've tried so far:
*Select page (Home) in dropdown menu, and click "Edit". Takes me to the index page, with no text in the area.
*Select page (Home) in dropdown menu, type in textarea, and click "Edit". Takes me to the index page, with no text in the area.
*Select page (Home) in dropdown menu, type in textarea, and click "Submit". Takes me to the index page, with no text in the area.
(Thanks so much for putting up with me. xD )
Click on home in the dropdown then click edit, meaning to edit the home page (it won't show anything at this point as you don't have anything saved in the database).
Now type something into the textarea (which would normally contain the page content).
Click submit to update the content.
Maybe change the 'submit' value to 'save changes' to make it a bit clearer.
Lol. Just looked at the code you posted again and it's because you've got
<form action="index.php" method="post">on your edit page, meaning the index page will process the form.
Change it to
<form action="" method="post">
No worries, glad we got there
I'm not sure if you've done it already, but remember that on your books page you need to edit the query to:
If you have any other problems with it just ask.PHP Code:
$result = mysql_query('SELECT content FROM pages WHERE page ="books"');
Everything's working great.
Just out of curiosity, would you have any idea how we might have the editor pick up on the current data?
Example, select the page you want to edit, click "Edit", previous table entry appears in editor.
That way, if someone makes a spelling error or something, they can just keep the same text, but change only a small bit of it.
Sorry, I'm confused! When you click edit after selecting a page, doesn't the current page already show in the textarea for edit? Does it just appear blank?
Me one step ahead, or you one step behind haha