I have a function that takes an array and creates an SQL statement based on the key / value pairs of the array. For instance:
name=>SomeKittens
He will turn into
(`name`) VALUES ('SomeKittens')
The only problem is that I am using a MySQL string function such as NOW() .
creation_date=>NOW()
turns into
(`creation_date`) VALUES ('NOW()')
Note that NOW() escaped. Is there a way to determine if a value is a MySQL string function? (except, of course, $value === "NOW()" )
I use Joomla DBO, but I am also open to PDO / MySQLi solutions.
( chat discussion )
source share