PHP-MYSQL HELP CONNECTION

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
peter70
Forum Newbie
Posts: 3
Joined: Sun May 30, 2010 7:42 pm

PHP-MYSQL HELP CONNECTION

Post by peter70 »

Hi everybody who is master php and the mysql i have created these code but nor working correctly what is wrong can any one help me here are what i did
popup player.php
[syntax]<<?php if (empty($id)) { ?>
<?php } else {
// you can fetch data from database result set using mysql_fetch_assoc()
$row = mysql_fetch_assoc($result);
?>

<table>
<tr>
<td><h1><?php echo $row['title'] ." by " . $row['artist']; ?></h1></td>
</tr>
<tr>
<td>
<td valign="top"> <div align="center"> <embed src="mydomail.com/path/<?php echo $row['filepath']; ?>
" type="audio/x-pn-realaudio-plugin" CONSOLE="Clip1"
CONTROLS="ControlPanel,StatusBar" HEIGHT="57" WIDTH="400" AUTOSTART="true"></div>
</td>
</tr>
</table><br>
<?php } ?>


<?php

if (isset($_GET['id'])) {
$id = $_GET['id'];


$link = mysql_pconnect('localhost','peter','123456');

mysql_select_db('audio');

$query = "INSERT INTO mp3s (id,artist,title,filepath)
VALUES (1,'John','I need','/path/music.mp3')";
$result = mysql_query($query);

$query = "SELECT * FROM mp3s WHERE id=".$id." LIMIT 1";
$result = mysql_query($query);

}

?>[/syntax]
when i upload it shows me a blank page whats wrong

here is the linten link

Code: Select all

<a href="/player.php?id=1">listen music</a>
i created a database and table and stored id title artist filepath in mysql
thanks am waiting your help please
User avatar
Jonah Bron
DevNet Master
Posts: 2764
Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California

Re: PHP-MYSQL HELP CONNECTION

Post by Jonah Bron »

If you are getting a blank page, then it's probably a fatal error. Turn on error reporting.

http://kb.siteground.com/article/How_to ... cript.html
Post Reply