Fire Query on CSV data
<p>I have a public google spreadsheet.I got the <code>CSV</code> data as an array from the remote URL.Then I displayed the information as an HTML list, referencing the appropriate array items.
Now I want to fire an php select query on it such that only the gossip of a particular actor is displayed.How to do it ?
(I want to use a variable $Name.wen I supply Name.I should get the gossip of that Actor.)</p>

<p>my excel sheet contains following columns</p>

<pre><code>&gt; 1.Sr No.
&gt; 2.Name
&gt; 3.Gossip
</code></pre>

<p>This is the code of my php page that retrieves the data as a list :</p>

<pre><code>$lines = file('https://docs.google.com/spreadsheet/pub?key=0AgzUC4MxdChJdFIyMHFUZ21PS053b3Z1OHFnbHJwYVE&amp;single=true&amp;gid=0&amp;output=csv');


$headers = array_shift($lines);


foreach ($lines as $line)
{

    $ldata =  explode(',', trim($line)); 

    if ($ldata[0] == '') break;
    echo '&lt;li&gt;Sr No.  &lt;strong&gt;' . $ldata[0] . '&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;Name  &lt;strong&gt;' . $ldata[1] . '&lt;/strong&gt;&lt;/li&gt;&lt;li&gt;Gossip &lt;strong&gt;' . $ldata[2] . '&lt;/strong&gt;&lt;/li&gt;';
}
</code></pre>
