I have a query in index.php and the exact same query in update.php. How can I have the query in a single location so it's easy to manage?

This is my query:

```
$sets=$_GET["sets"];
$sets = "'" . str_replace(array("'", ","), array("\\'", "','"), $sets) . "'";

// test code
$query = " 
    SELECT 
        *
    FROM
        `cards`
    WHERE
        `setName` in ($sets)
    ORDER BY
        `setName` DESC,
    LIMIT
        500
";

```