0

please i need your help , there is audio playlist im working on and im try to get music from mydql database and i can get the music file to play but playlist is blank. this is my code
html code:

<ul id="playlist1" style="display:none;">
        <li data_path="assets/mp3/music1.mp3" data-thumbpath="assets/thumbnail/img.jpg" data-downloadable="yes" >
            <p><span style="font-weight:bold;">Adonai</span> - Sarkodie ft. Castro</p>
        </li>
        <li data_path="assets/mp3/music2.mp3" data-thumbpath="assets/thumbnail/img2.jpg" data-downloadable="yes" >
            <p><span style="font-weight:bold;">Dancehall</span> - Shatta Wale ft. Sarkodie</p>
        </li>
    </ul>

mtemplate code:

<?php
return <<<EOT
<li data_path="http://localhost/root/admin/music/%s" data_thumbpath="http://localhost/root/admin/images/%s"  data-downloadable="yes" >
    <p><span style="font-weight:bold;">%s</span></p>
</li>
EOT;
?>

then php:

<?php
    $template = include('mtemplate.php');
    $mysqli = new mysqli("localhost", "root", "", "database");
    if ($mysqli->connect_errno) {
        echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
    }
    $result= $mysqli->query("select * from music order by id  DESC" ) or die (mysql_error());
    $output = '';
    while($row = $result->fetch_assoc())
    {
        $output .= sprintf($template, $row['data_path'], $row['data_thumbpath'], $row['span']);
    }
    ?>
    <ul id="playlist1" style="display:none;">
        <?=$output?>
    </ul>

with the above code, i can get the player to play only the music file but playlist is not showing. thanks for your help.

2
Contributors
2
Replies
15
Views
2 Years
Discussion Span
Last Post by WebMedia_1
1

remove the style="display:none;" from

    <ul id="playlist1" style="display:none;">
        <?=$output?>
    </ul>
Votes + Comments
Still laughing. Heh heh.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.