How to dynamically set variables php, design pattern
<p>I have several php scripts that have the following structures:</p>

<pre><code>$count = $_GET['count'];
$sort = $_GET['sort'];
$car = $_GET['car'];
$driver = $_GET['driver'];

...

$SQL = "SELECT car, truck FROM autos WHERE car='$car' AND truck='truck'";

...
</code></pre>

<p>Another script will be the identical script except rather than car, truck or the table autos I will be working with another table, different variables and possibly more or less variables.  Is there a way or a good design pattern to use such that I only have to write one instance of this script vice the 15 or so I might otherwise have to write.</p>
