Using a while loop for videos (MYSQL AND PHP)



I am using a mysql database to sent out a playlist page to the user. For instance, “playlist.php”. This php file contains an image with a link attached that when click will take the user to another php file titled “videos.php”. Then based on my _GET I retrieve which video was selected on the previous page by its ID number. This is located in the browser’s url bar as$id
v is the _GET variable that is being looked for, and the $id just stands for the value of the video’s id that was from the previous page.

How would I code this into a while loop so each page would have a specific window with only that video in that player on the following page (videos.php).

This is what I have so far. Please points out any possible issues.

I am using the code for windows media player because the url is to a wmv file.


// connect and mysql include

$id = $_GET[‘v’];
$query = mysql_query(“SELECT url FROM sdplaylist ORDER BY id LIMIT 1”);

$numrows = mysql_num_rows($query);

while ($row = mysql_fetch_assoc($query):wink:
$id = $row[‘id’];
$url = $row[‘url’];

"> " autostart="true" designtimesp='5311' loop="false"> <?php }


Thank you for your time.


Anyone? If you need more information, just ask. I really would like to finish this project.


[php]$query = mysql_query(“SELECT url FROM sdplaylist WHERE id=’$id’”);[/php]

Selecting by id will give you the desired results.