./admin/index.php:304:$url_results = yourls_get_db('read-admin_index')->fetchObjects( "SELECT * FROM `$table_url` WHERE 1=1 {$where['sql']} ORDER BY `$sort_by` $sort_order LIMIT $offset, $perpage;", $where['binds'] );
./includes/Database/Options.php:46:$sql = "SELECT option_name, option_value FROM $table WHERE 1=1";
./includes/Database/Options.php:105:$sql = "SELECT option_value FROM $table WHERE option_name = :option_name LIMIT 1";
./includes/Database/Options.php:164:$sql = "UPDATE $table SET option_value = :value WHERE option_name = :name";
./includes/Database/Options.php:209:$sql = "INSERT INTO $table (option_name, option_value) VALUES (:name, :value)";
./includes/Database/Options.php:240:$sql = "DELETE FROM $table WHERE option_name = :name";
./includes/functions-shorturls.php:259:$delete = $ydb->fetchAffected("DELETE FROM `$table` WHERE `keyword` = :keyword", array('keyword' => $keyword));
./includes/functions-shorturls.php:289:$insert = $ydb->fetchAffected("INSERT INTO `$table` (`keyword`, `url`, `title`, `timestamp`, `ip`, `clicks`) VALUES(:keyword, :url, :title, :timestamp, :ip, 0);", $binds);
./includes/functions-shorturls.php:320:$url_exists = yourls_get_db('read-long_url_exists')->fetchObject("SELECT * FROM `$table` WHERE `url` = :url", array('url'=>$url));
./includes/functions-shorturls.php:359:$old_url = $ydb->fetchValue("SELECT `url` FROM `$table` WHERE `keyword` = :keyword", array('keyword' => $keyword));
./includes/functions-shorturls.php:363:$new_url_already_there = intval($ydb->fetchValue("SELECT COUNT(keyword) FROM `$table` WHERE `url` = :url;", array('url' => $url)));
./includes/functions-shorturls.php:379:$sql = "UPDATE `$table` SET `url` = :url, `keyword` = :newkeyword, `title` = :title WHERE `keyword` = :keyword";
./includes/functions-shorturls.php:429:$update = $ydb->fetchAffected("UPDATE `$table` SET `title` = :title WHERE `keyword` = :keyword;", array('title' => $title, 'keyword' => $keyword));
./includes/functions-shorturls.php:518:$infos = $ydb->fetchObject("SELECT * FROM `$table` WHERE `keyword` = :keyword", array('keyword' => $keyword));
./includes/functions-shorturls.php:626:$res = yourls_get_db('read-get_keyword_stats')->fetchObject("SELECT * FROM `$table_url` WHERE `keyword` = :keyword", array('keyword' => $shorturl));
./includes/functions-shorturls.php:663:$sql = "SELECT `keyword` FROM `$table` WHERE `url` = :url";
./includes/functions-upgrade.php:313:$next_id = yourls_get_db('read-update_options_to_14')->fetchValue("SELECT `next_id` FROM `$table`");
./includes/functions-upgrade.php:415:$sql = "SELECT `keyword`,`url` FROM `$table` WHERE 1=1 ORDER BY `url` ASC LIMIT $from, $chunk ;";
./includes/functions-upgrade.php:425:if( true === $ydb->perform("UPDATE `$table` SET `keyword` = '$newkeyword' WHERE `url` = '$url';") ) {
./includes/functions.php:100:$update = "UPDATE `$table` SET `clicks` = :clicks WHERE `keyword` = :keyword";
./includes/functions.php:104:$update = "UPDATE `$table` SET `clicks` = clicks + 1 WHERE `keyword` = :keyword";
./includes/functions.php:176:$results = yourls_get_db('read-get_stats')->fetchObjects( "SELECT * FROM `$table_url` WHERE 1=1 ORDER BY $sort_by $sort_order LIMIT $start, $limit;" );
./includes/functions.php:213:$totals = yourls_get_db('read-get_db_stats')->fetchObject( "SELECT COUNT(keyword) as count, SUM(clicks) as sum FROM `$table_url` WHERE 1=1 " . $where['sql'] , $where['binds'] );
./includes/functions.php:540:$result = yourls_get_db('write-log_redirect')->fetchAffected("INSERT INTO `$table` (click_time, shorturl, referrer, user_agent, ip_address, country_code) VALUES (:now, :keyword, :referrer, :ua, :ip, :location)", $binds );
./includes/functions.php:682:$lasttime = yourls_get_db('read-check_ip_flood')->fetchValue( "SELECT `timestamp` FROM $table WHERE `ip` = :ip ORDER BY `timestamp` DESC LIMIT 1", [ 'ip' => $ip ] );
./yourls-infos.php:61:$sql = "SELECT `referrer`, COUNT(*) AS `count` FROM `$table` WHERE `shorturl` $keyword_range GROUP BY `referrer`;";
./yourls-infos.php:96:$sql = "SELECT `country_code`, COUNT(*) AS `count` FROM `$table` WHERE `shorturl` $keyword_range GROUP BY `country_code`;";
./yourls-infos.php:112:$sql = "SELECT DATE_FORMAT(`click_time`, '%Y') AS `year`, DATE_FORMAT(`click_time`, '%m') AS `month`, DATE_FORMAT(`click_time`, '%d') AS `day`, COUNT(*) AS `count` FROM `$table` WHERE `shorturl` $keyword_range GROUP BY `year`, `month`, `day`;";
./yourls-infos.php:157:$sql = "SELECT DATE_FORMAT(DATE_ADD(`click_time`, INTERVAL " . $offset . " HOUR), '%H %p') AS `time`, COUNT(*) AS `count` FROM `$table` WHERE `shorturl` $keyword_range AND DATE_ADD(`click_time`, INTERVAL " . $offset . " HOUR) > (DATE_ADD(CURRENT_TIMESTAMP, INTERVAL " . $offset . " HOUR) - INTERVAL 1 DAY) GROUP BY `time`;"To build the list:
grep -rnE "SELECT|UPDATE|INSERT|DELETE" . --include=*.php | grep -v "vendor/" | grep -v "tests/" > sql.txt