I am making this becausde i have an online radio and i want it so that my visitors can make requests as you can see in my code below...
But the thing is sense I am not going to make an application that plays music as it is requested automatically and I will have Dj's I need a way to delete songs from this page I already have created in which automatically delets them from the database...
ex.
Joe and Moe (2 visitors)
Joe wants to hear Hot in herre by Nelly and Moe wants to hear My band by M&M :-P
They fill out the request form the info gets added to the MySQl database and all is good... :-D
Then the Dj looks at the page I have the code to listed below.
And sees their request so he plays hot in herre and when it is done he has a button that says delete to delete that from the page asn the next song becomes #1 to be played...
How do I get the delete image to show up by each entry?
Please post the code as whole so i do not have to peice it together... Thanks!
(WHAT I HAVE)
<?php
$host = "localhost";
$user = "xfactor-";
$pass = "dexter";
$db = "xfactor-_goddess";
$table = "requests";
$show_all = "SELECT * FROM $table";
//------------------------
-+
//Connect to the server.
//------------------------
-+
mysql_connect("$host", "$user", "$pass")
or die (mysql_error ());
//------------------------
-+
//Select the database.
//------------------------
-+
mysql_select_db("$db")
or die (mysql_error ());
//------------------------
-+
//Give the page a header.
//------------------------
-+
echo "<b><center>Song Requests</center></b><br><
br>";
//$result is now equal to this entire code --mysql_query ($show_all) or die (mysql_error ());--
$result = mysql_query ($show_all)
or die (mysql_error ());
//------------------------
----------
----------
----------
----------
--+
//Display The Table And Get The Requests... Get This Party Started!
//------------------------
----------
----------
----------
----------
--+
?>
<center>
<table width="100%" border="1">
<tr>
<td width="13%">Number</td>
<td width="13%">Artist</td>
<td width="13%">Song Title</td>
<td width="13%">Requesters Name</td>
<td width="35%">Comments</td>
<td width="13%">Delete</td>
</tr>
<?php
while ($row = mysql_fetch_array ($result)) {
?>
<tr>
<td>
<?php echo $row['num']; ?>
</td>
<td>
<?php echo $row['artist']; ?>
</td>
<td>
<?php echo $row['title']; ?>
</td>
<td>
<?php echo $row['name']; ?>
</td>
<td>
<?php echo $row['comments']; ?>
</td>
</tr>
<?php
}
?>
</table>
</center>
Once this question is solved I will make a new question and supply all of you with the link so you can help me with my next step...
Then I beleive all my questions will be solved. :-D
Start Free Trial