Dynamic query with varying variables?
<p>Sorry if the title seems misleading, I wasn't sure of the best way to put it.</p>

<p>I have a 2 column table, in the table there's a list of USER_ID's and INTEREST's. </p>

<p>On my page I have a query which calls all interests and puts them into a jquery marquee. </p>

<p>I would like to make each value link to a page that then runs a query and displays all USER_ID's with the same INTEREST. </p>

<p>In my head the only way (I know how) is to have a list of IF statements that contain queries, so </p>

<pre><code>if($value = 'soccer'){run query that gets all users with soccer as interest}
elseif($value = 'tennis'){run query that gets all users with tennis as interest}
and so on...
</code></pre>

<p>as the values wont be set its impossible for me to write this page, Whats the best way to build this? </p>

<p>Im still a brginner with PHP so any helps greatly appreciated!
Thanks</p>
