|
function FindSQLClause($strSQL, $strBeingSought, $strEndKeywords) { //finds and returns the where condition in SQL set_time_limit(10); //$strBeingSought="where"; //$strEndKeywords="group having order limit procedure into for"; $strLcaseSQL=strtolower($strSQL); $intSoughtPos=strpos($strLcaseSQL, $strBeingSought); $strPossibleClause=substr($strSQL, $intSoughtPos + strlen($strBeingSought)); $intPostEnd=strlen($strPossibleClause); //echo $intPostEnd; $intOldPostEnd=-900; while($intPostEnd>0 && $intOldPostEnd!=$intPostEnd) { $intOldPostEnd=$intPostEnd; $intPostEnd=PosInList($strEndKeywords, $strPossibleClause, " ", true, $quotechar="'"); //echo $intPostEnd . "=poswhere function FindSQLClause($strSQL, $strBeingSought, $strEndKeywords) { //finds and returns the where condition in SQL set_time_limit(10); //$strBeingSought="where"; //$strEndKeywords="group having order limit procedure into for"; $strLcaseSQL=strtolower($strSQL); $intSoughtPos=strpos($strLcaseSQL, $strBeingSought); $strPossibleClause=substr($strSQL, $intSoughtPos + strlen($strBeingSought)); $intPostEnd=strlen($strPossibleClause); //echo $intPostEnd; $intOldPostEnd=-900; while($intPostEnd>0 && $intOldPostEnd!=$intPostEnd) { $intOldPostEnd=$intPostEnd; $intPostEnd=PosInList($strEndKeywords, $strPossibleClause, " ", true, $quotechar="'"); //echo $intPostEnd . "=poswhere
|