Update: I've changed it into
"/^(\*|[a-z_,
\(\)0-9]+)[\s]+FROM[\s]+([a-z_\.]+)(\s+)?(WHERE[\s]+(.+))?\s*(LIMIT\s+([0-9]+)\s*,\s*([0-9]+))?\s*(ORDER
BY ([a-z0-9, ]+)?(\s*(DESC|ASC)))?$/Ui"
Only problem that on:
SELECT * FROM table WHERE field2='field3' ORDER BY id DESC LIMIT 0,10
it outputs
Arra
You all misunderstood my question, please read my replies above...
I'm looking to extract it from a string - *I'm not executing the queries, I
only get them as a string*
And to the topic:
Since everything I found was very complicated to parse, I've crafted my own
preg pattern,
"/^(\*|[a-z_, \(\
> -Original Message-
> From: Nisse Engström [mailto:news.nospam.0ixbt...@luden.se]
>
> If you're using MySQL, you can try mysql_field_name()
> and see if it gets you anywhere. I don't think it works
> on empty results though.
FYI. It will.
--
PHP General Mailing List (http://www.php.ne
On Wed, 19 Aug 2009 22:42:36 +0300, דניאל דנון wrote:
> Lets assume I have the following string:
> "SELECT field1, field2, field3 FROM tablename WHERE field1 = 'something' "
>
> Is there any way to get "field1, field2, field3"? assuming it might also
> have join, left join - things like that.
If
4 matches
Mail list logo