Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

PHP Script for MySQL database and XML

Posted on 2010-11-21
4
Medium Priority
?
268 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 111

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 51

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 a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

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

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…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

688 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