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 */;
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
Okay... that's done. But it still doesn't show anything in the area.
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.
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.
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).
I've tried that, and it just takes me to the index page with nothing in the editable area.
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.
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.
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?
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?