I have php files with SQL queries broken into multiples lines. for example:
$sql = "select count( aa." . BOOK_ART_ID . ") as book_count
from " . BOOK_ART_TABLE . " as aa
inner join " . AUTHER_TABLE . " as l on aa." . BOOK_ART_AUTHER_ID . " = l." . AUTHER_ID . " AND
l." . AUTHER_CODE . " = '" . "'
where aa." . BOOK_ART_TITLE_ID . " = " . $book_id;
I'm trying to extract all SQL statements from the PHP files. I tried grep on $sql and only getting the first line back.
How do I extract entire SQL string from all PHP files?
I was thinking more around deleted line break until ';' character.