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.

remove the style="display:none;" from

    <ul id="playlist1" style="display:none;">
        <?=$output?>
    </ul>
commented: Still laughing. Heh heh. +15

thanks i ve figure it out myself, it is working now

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.