I need to replace string between first SELECT and first FROM, but still not working if I try this :
Here is my SQL string to replace :
$strSQLreport = "SELECT ... FROM ... WHERE ... AND volu_id IN (SELECT FK_volu_id FROM)"
Here is my preg_replace :
preg_replace( "/SELECT(.*)FROM/s", "SELECT volu_id AS id FROM", $strSQLreport, 1 )
It takes the second from, and I want only replace before de first FROM! Thanks for help!