Create .sql file for php script

Based on the ‘near…’ text in the error message, $prefix contains just a - (dash) or ends in a -. This character is not permitted in a plain identifier. Since the posted line of code using $prefix doesn’t contain the identifier quote character ` (back-tick), the simplest fix would be to make sure that $prefix only contains ASCII: [0-9,a-z,A-Z$_] (basic Latin letters, digits 0-9, dollar, underscore).