$query) { $qmCount = substr_count($query, '?'); $execArgs = trim($matches[3][$idx]); $argCount = 0; if ($execArgs !== '') { $argCount = count(explode(',', $execArgs)); } if ($qmCount != $argCount && !strpos($execArgs, '...')) { echo "Mismatch in $file: query has $qmCount ?, but execute has $argCount args.\n"; echo "Query: $query\n"; echo "Args: $execArgs\n\n"; } } } echo "Check done."; ?>