Revisited: Creating an XML Content Feed With PHP - Creating a sample content feed (Page 3 of 6 )
create database content;
Next, create a new table named articles. This table will contain all of our news items:
create table articles
articleId int auto_increment not null,
The table we've just created should be pretty self-explanatory. It contains three fields: articleId, an integer which is also a primary key and unique identifier. Title, which will contain the headline of each news item, and content, which is a text field that will contain the body of our news item.
Let's add three news items to our articles table using the following MySQL commands:
insert into articles values(0, 'PHP scripting language takes world by storm', 'It was announced today that at least two million web sites around the world are using the PHP and MySQL language/databasing technique to create sites that are flexible');
insert into articles values(0, 'Linux includes G++ compiler', 'Linux, one of the worlds most popular operating systems also includes a copy of both the GCC and G++ compilers, which allow you to compile C/C++ program easily from the command line');
insert into articles values(0, 'Microsoft announces C#', 'Microsoft have today announced that its new .NET framework will be based around a language named C# (pronounced C-Sharp). This language is much like C++ but designed for moder n prorgammers');
$db_server = "localhost";
$db_db = "content";
$db_user = "admin";
$db_pass = "password";
Our script starts of by creating four variables which will be used to login to our MySQL server. I'm assuming that MySQL is installed on the same machine as where the feed.php script will be setup.