Hi Ray
Sussed it!
The MySQLi behaviour (the same as its predecessor) puts %% in the code, which the mysql_I behaviour doesn't like!
Change the %% to % and everything works fine.
I should have remembered this, as I've come across it several times.
Thanks for your help
Cheers
Chris