in reply to DBD and a MySQL query with a SET @num line

Did you try SET @num=0;--other statement(s)?

Worked for me from mysql client. Sorry i can't copy & paste from that f*****g CITRIX/Putty terminal.

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»