The following works as intended in MySQL (phpMyAdmin):
SET @randomComposer=(SELECT composer FROM compositions ORDER BY RAND() LIMIT 1);
SELECT * FROM compositions WHERE composer!='' AND composer=@randomComposer;
But I am unable to carry this over into PHP. Using query concatenation, syntax highlighting fails at the start of the SET… line and I get an error querying the database. How do I convince PHP to recognise the working MySQL?
(Research brought me to mysqli_multi_query, which I understand is the route I need to follow, but I first need to sort out PHP's aversion to SET.)