Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-07-2006, 06:59 PM   #1 (permalink)
Hooch
Registered User
 
Join Date: May 2006
Posts: 4
Hooch is on a distinguished road
xml - php - mysql

Hello all.
I have been googling for quite a bit but I have not found any helpful solutions to my idea.
I am going to upload mp3's to a database via upload script.
Then along with the mp3 I would enter the song name and band.
Is it possible to have the xml get the info from the database somehow?

I would like to make a very user friendly mp3 player.
This way the user could run the php script to enter the table. No mysql knowledge needed.
Then have a form where you upload the mp3 and also enter the song/band name.
If this is possible could someone please show me the code for executing this?
How would this code look to get an mp3 from a database?
Code:
<?xml version='1.0' encoding='utf-8'?>
<songs>
<song name="Pixel2Life Soundtrack 01" file="music/p2l_01.mp3" />
<song name="Twodded Soundtrack 01" file="music/twod_01.mp3" />
</songs>
If this was my database..
Code:
<?php
include "includes/db.php";

$query = 'DROP TABLE `tunz`';
$result = mysql_query($query);

$query = 'CREATE TABLE `tunz` (
id int(11) NOT NULL auto_increment,
songname varchar(32) NOT NULL UNIQUE,
band varchar(32) NOT NULL,
mp3 varchar(32) NOT NULL,
PRIMARY KEY (`id`))
ENGINE=INNODB;';

$result = mysql_query($query);
echo "Table Created!";
?>
Thank you..Hooch
Hooch is offline   Reply With Quote
Old 05-08-2006, 01:00 AM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 596
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
You can make apache send xml files through php's prepocessor to allow php to generate xml. That way php would put the results of the database call in the xml file.

To have the user download music you'd have to generate a link to the file. Then they could click save as from the browser or point wget towards it.
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote
Old 05-08-2006, 03:21 AM   #3 (permalink)
Hooch
Registered User
 
Join Date: May 2006
Posts: 4
Hooch is on a distinguished road
I know zilch about xml.
Is there a tut anyone could point me to? I can't seem to find any helpfull info on xml.
Hooch is offline   Reply With Quote
Old 05-08-2006, 08:50 AM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,444
sde is on a distinguished road
i'm not completely understanding all your questions. we probably need more info to be of much help.

Quote:
Is it possible to have the xml get the info from the database somehow?
you could send XML in a post request and have PHP parse through it and send back data from the database. since they still have to send a POST request, you may as well have them send their request without xml.

what information exactly do you want XML to send? is this just for uploading the song data? or is it for browsing and selecting songs too?

why does it have to be an XML request? who is the user? another programmer? or someone just tyring to listen manage their songs? if it is the latter, then all they care about is the interface they're using, .. not if it's controlled by xml. i have a feeling it's more complicated than that, but the original post isn't that specific.
__________________
Mike
sde is offline   Reply With Quote
Old 05-08-2006, 10:06 AM   #5 (permalink)
Hooch
Registered User
 
Join Date: May 2006
Posts: 4
Hooch is on a distinguished road
Hi
I am wanting to make things alot easier for a cpl sites I help out at.
I have an .swf file that plays mp3's.
The xml code I showed (in the 1st post) is how the .swf file gets the info.
I want to make a form that the admins can upload the mp3's and name of song and band.
Then I was wondering if that xml code could be changed so it took that info from the database.
I know this is wrong, but something like..
Code:
<?xml version='1.0' encoding='utf-8'?>
<songs>
<song name=$row[song] file=$row[mp3]/>
</songs>
This way files could come and go without changing the xml file. And moderators without ftp access could upload mp3's and not need to change anything else. Very automated.

Is it even possible?
Thank you
Hooch is offline   Reply With Quote
Old 05-23-2006, 04:32 AM   #6 (permalink)
Hooch
Registered User
 
Join Date: May 2006
Posts: 4
Hooch is on a distinguished road
To update I got it working.
Hooch is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Flash8, PHP and MySQL Redline All Other Coding Languages 2 05-02-2006 10:04 PM
Help with outside connection to mysql using a php page ericanca PHP 11 07-19-2005 10:33 AM
Help with outside connection to mysql using a php page ericanca Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 1 04-18-2005 07:37 PM
WML PHP and MySQL rmill9681 PHP 10 11-20-2004 12:59 PM
cant connect to mysql databases using php eran PHP 11 08-07-2004 08:02 AM


All times are GMT -8. The time now is 08:37 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting