Solved

PHP Script for MySQL database and XML

Posted on 2010-11-21
4
236 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 108

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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.

708 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now