For those who are interested I found the answer. The $songid
issued by the php is a string and not an integer, so I had to add parseInt();
to my javascript. The javascript looks like that now :
function playthis(refid){
refid = parseInt(refid);
myPlaylist.select(refid);
myPlaylist.play();
}