Link to home
Start Free TrialLog in
Avatar of street9009
street9009Flag for United States of America

asked on

Combining SUBSTRING and LOCATE functions

SELECT SUBSTRING(Data, LOCATE('mssql_',Data), (LOCATE(')', Data) - LOCATE('mssql_',Data) +1)   FROM `mssql` WHERE 1

Open in new window


Basically I created a MySQL table that houses records that have PHP lines of code with MSSQL Function calls in them. So the records may look like this:

AutoID | Data
1          |  $connection = mssql_connect($server, $user, $pwd);
2          |  $result = mssql_query($query, $mssqlconn);

Something like that. Basically I am just trying to get the mssql_ function and its parameters returned in a result (so the first record would return "mssql_connect($server, $user, $pwd)". I *thought* the above query would do it, but it's giving me an error.

Anyone know what I'm doing wrong?
ASKER CERTIFIED SOLUTION
Avatar of johanntagle
johanntagle
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial