"NotGiven" wrote in message
> Here's the pertinent code to get the SQL results. It is generated by
> dreamweaver adn I'm trying to learn to code php so I don't depend on DW to
> do it for me.
>
> $query_rsSummary = "SELECT sid, Count(wid) FROM plotting GROUP BY sid";
> $rsSummary = mysql_query($query_rsSummary, $tableG) or die(mysql_error());
> $row_rsSummary = mysql_fetch_assoc($rsSummary);
>
>
> How do I search the array to see if a certain "sid" has an entry in the
> array?
You may find aliases invaluable, especially when working with group by
functions:-
$query_rsSummary = "SELECT sid, Count(wid) AS c_wid FROM plotting GROUP BY
sid";
$rsSummary = mysql_query($query_rsSummary, $tableG) or die(mysql_error());
<a rel="nofollow" style='text-decoration: none;' href="http://www.php.net/manual/en/function.mysql-fetch-assoc.php" target="_blank">http://www.php.net/manual/en/function.mysql-fetch-assoc.php</a>
while($row = mysql_fetch_assoc($rsSummary))
{
if($row['sid'] == 'whatever')
{
printf("SID %s occurs %s times in this data",
$row['sid'],
$row['c_wid']);
}
}
>> Stay informed about: how do I search two-dimiensional results set array