Dynamic Video Playlist

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
mr_mustash
Forum Newbie
Posts: 1
Joined: Tue Sep 01, 2009 3:51 pm
Location: Corvallis, OR

Dynamic Video Playlist

Post by mr_mustash »

Hey everyone,

I'm new to this forum and to PHP and have what is likely quite a trivial problem. I've been trying to create a video playlist that is dynamically created using PHP and MySQL. The code that I have below makes sense to me but it doesn't generate the playlist at all. I was wondering if any of you guys could be able to give me some quick help and let me know what's going on.

Cheers,
Patrick

Code: Select all

        
 
             <div id = "video_list">
    
            <h1>Video List</h1>
            <hr>
    
            <?          
            $user="usr";
            $password="psword";
            $database="dbname";
            $server="server";
 
            mysql_connect($server,$user,$password);
            @mysql_select_db($database) or die("Unable to select database");
            $query="SELECT * FROM playlist";
            $result=mysql_query($query);
 
            $num=mysql_numrows($result);
 
            mysql_close();
            
            $i=1;
            while ($i < $num) {
 
            $author=mysql_result($result,$i,"author");
            $date=mysql_result($result,$i,"date");
            $description=mysql_result($result,$i,"description");
            $url=mysql_result($result,$i,"url");
            $img=mysql_result($result,$i,"img");
            ?>
                
            <div id= "<? echo $i; ?>" class="video_info">
                <div id = "video_info"> 
                    <p><author><? echo $author; ?></author> <date><? echo $date; ?></date><br>
                    <p><discription><? echo $description; ?></discription>
                </div>
            
                <dif id = "video_icon">
                    <p><a href="<? echo $url; ?>"><img src ="<? echo $img; ?>"></a>
                </div>
            <div>
            <hr>
            
            
            <?
            $i++;
            }
            ?>
            
        </div><!-- end video list -->
 
User avatar
akuji36
Forum Contributor
Posts: 190
Joined: Tue Oct 14, 2008 9:53 am
Location: Hartford, Connecticut

Re: Dynamic Video Playlist

Post by akuji36 »

description looks like it is misspelled.

You spelled it with an using an i second time around.
Post Reply