"NotGiven" <no****@nonegiven.net> wrote in message
news:4l*******************@bignews5.bellsouth.net. ..
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());
http://www.php.net/manual/en/functio...etch-assoc.php
while($row = mysql_fetch_assoc($rsSummary))
{
if($row['sid'] == 'whatever')
{
printf("SID %s occurs %s times in this data",
$row['sid'],
$row['c_wid']);
}
}