Solved

PHP Script for MySQL database and XML

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mysql sync between 3-4 mysql db 4 25
How many transactions can mysql handle? 3 22
Move wordpress site 3 26
How to count in a table in php 22 19
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…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

863 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

21 Experts available now in Live!

Get 1:1 Help Now