Solved

PHP Script for MySQL database and XML

Posted on 2010-11-21
4
250 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 110

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
When table data gets too large to manage or queries take too long to execute the solution is often to buy bigger hardware or assign more CPUs and memory resources to the machine to solve the problem. However, the best, cheapest and most effective so…
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 count occurrences of each item in an array.

696 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