i’m trying to echo some result in php in the javascript but it keeps not working messing up the interface of the javascript player
that’s the full javascript :
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
new jPlayerPlaylist({
jPlayer: "#jquery_jplayer_1",
cssSelectorAncestor: "#jp_container_1"
}, [
{
title:"Name",
mp3:"audio.mp3",
},
], {
swfPath: "js",
supplied: "oga, mp3",
wmode: "window"
});
});
//]]>
</script>
i want to replace this :
{
title:"Name",
mp3:"audio.mp3",
},
with this :
while(
$row = mysql_fetch_assoc($result)) {
$sender = $row['sender'];
$sender_name_query = mysql_query("SELECT fullname FROM users WHERE id = '$sender'");
$sender_name = mysql_fetch_object($sender_name_query);
$sender_fullname = $sender_name->fullname;
echo '{<br/>title:"' . $sender_fullname . '",<br/>mp3:"link",<br/>},';
}
it’s a while loop i need it to get all the results
can anyone pls help in how to replace it ?
thanks
yet another solution. You could do: