i want to convert the following sql query:
'UNIQUE KEY `UNIQUE_TAG` (`identifier`,`keyname`)'
into this:
'CONSTRAINT `UNIQUE_TAG` UNIQUE (`identifier`,`keyname`)'
My problem is, i have to grab the first keyword as a var, like this:
'<$1> KEY `UNIQUE_TAG` (`identifier`,`keyname`)'
to get it here
'CONSTRAINT `UNIQUE_TAG` <$1> (`identifier`,`keyname`)'
Have a look at http://www.sqlite.org/lang_createtable.html to see the syntax of sqlite compatible SQL.
I want to do it in PHP, but i have no idea how to get this done.
Thanks in advance.