Search and Fetch string values in comma separated string which match the post variable from URL PHP MySql
<p>Hi i have a sql table like this</p>

<pre><code>id     fname     cat                              address        status

1      Bash      Wedding venue                      ABC            a
2      Ashu      Wedding venue, Wedding card        BCD            a
3      jash      Wedding venue                      ABC            a
4      hash      Wedding venue                      BCD            a   
5      Rash      Wedding card                       BCD            a
</code></pre>

<p>Id "2" has 2 cat values. What i want is to fetch id "2" in both cases whether post variable in URL is "Wedding venue" or "Wedding cat". In detail if URL is something like </p>

<pre><code>www.example.com/list.php?cat=Wedding venue
</code></pre>

<p>Output:</p>

<pre><code>id     fname     cat                              address        status

1      Bash      Wedding venue                      ABC            a
2      Ashu      Wedding venue, Wedding card        BCD            a
3      jash      Wedding venue                      ABC            a
4      hash      Wedding venue                      BCD            a
</code></pre>

<p>And for URL </p>

<pre><code>www.example.com/list.php?cat=Wedding card
</code></pre>

<p>Output:</p>

<pre><code>id     fname     cat                              address        status

2      Ashu      Wedding venue, Wedding card        BCD            a
5      Rash      Wedding card                       BCD            a
</code></pre>