Solved

PHP Script for MySQL database and XML

Posted on 2010-11-21
4
242 Views
Last Modified: 2012-05-10
I want to make a TV Guide for my remote, which supports javascript and xml.
The XML data I can get from any epg grabber, so that's not a problem. I want to make a dynamic page which shows the xml data like this one:

http://www.ostrea-honfleur.fr/pronto/progtv.php

I also have the MySql database. Basically I need help with a script, that can make my data update itself like the one in the link above. I have no knowledge of PHP whatsoever.

The database looks like this:

--
-- database: `ostrea-honfleur_pronto`
--

-- --------------------------------------------------------

--
-- Structure de la table `chaines`
--

CREATE TABLE IF NOT EXISTS `chaines` (
`id_chaine` varchar(50) NOT NULL default '',
`nom_chaine` varchar(100) NOT NULL default '',
`icon` varchar(250) NOT NULL default '',
PRIMARY KEY (`id_chaine`),
KEY `nom_chaine` (`nom_chaine`)
) TYPE=MyISAM;

-- --------------------------------------------------------

--
-- Structure de la table `logs`
--

CREATE TABLE IF NOT EXISTS `logs` (
`id_log` bigint(20) NOT NULL auto_increment,
`details` text NOT NULL,
`date` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`id_log`)
) TYPE=MyISAM AUTO_INCREMENT=70 ;

-- --------------------------------------------------------

--
-- Structure de la table `programmes`
--

CREATE TABLE IF NOT EXISTS `programmes` (
`id_chaine` varchar(50) NOT NULL default '',
`titre` varchar(250) NOT NULL default '',
`sous_titre` varchar(250) NOT NULL default '',
`description` text NOT NULL,
`categorie` varchar(250) NOT NULL default '',
`date_start` datetime NOT NULL default '0000-00-00 00:00:00',
`date_end` datetime NOT NULL default '0000-00-00 00:00:00',
KEY `id_channel` (`id_chaine`)
) TYPE=MyISAM;


The XML data is similar to the link above.
0
Comment
Question by:Brasch
  • 2
4 Comments
 
LVL 109

Expert Comment

by:Ray Paseur
ID: 34187844
Starting from this point: "I have no knowledge of PHP whatsoever."

You would need some knowledge of PHP.  What you described here is not a beginner's application.  If you want it done, you should hire a developer.  

If you want to learn PHP, this is an excellent book to get you started.  Give yourself a month or two to work through the application-building examples and you will be way ahead.  it will not make you a pro, but it is easy to read, and has a downloadable code library that you can copy and modify for your own use.
http://www.sitepoint.com/books/phpmysql4/

It looks like the XML generated by the progtv script is valid and can be interpreted into an object, so that is good news.
<?php // RAY_temp_brasch.php
error_reporting(E_ALL);
echo "<pre>";

$url = 'http://www.ostrea-honfleur.fr/pronto/progtv.php';
$xml = file_get_contents($url);
$obj = SimpleXML_Load_String($xml);
var_dump($obj);

Open in new window

0
 
LVL 50

Expert Comment

by:Steve Bink
ID: 34189489
I'm with Ray_Paseur - you will need to learn PHP to accomplish this, and this is not the venue to learn it.  Along with the link he posted, I highly recommend the source of everything PHP:

http://www.php.net/manual/en/index.php

At the top of the page is a selection box for language, if necessary.  I would start with the chapters titled "Language Reference", "Security", and "Features".  That is the "grammer" portion of the language.  The "Function Reference" sections are the vocabulary.  If you are using MySQL, you'll want to look at the MySQL and MySQLi libraries, and perhaps the PDO library, depending on your needs and preferred strategies.  For XML, the DOM and SimpleXML libraries collectively include all the necessary tools to manipulate XML as you require, and they are roughly compatible with minimal effort.  On many pages, the user comments are just as valuable, if not more so, than the actual text of the manual.  Going through them can provide some valuable insight to someone just starting out.

Once you have a starting point for your project, start coding.  When you run into roadblocks, come back with specific questions and we can guide you through them.
0
 

Accepted Solution

by:
Brasch earned 0 total points
ID: 34490930
found the solution myself
0
 

Author Closing Comment

by:Brasch
ID: 34523585
I found the solution elsewhere
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
php convert date format 3 21
error log using ftp 7 40
How can I make this form submit to itself? 10 27
Cookie not unsetting 7 19
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question