michaelsanford
Translator, Web Developer
I know this is basic but I'm having problems determining if my MySQL result set is the Empty Set.
YT = Yukon. I have a separate (I know it's inefficient, but I don't particularly mind this time) SELECT for each province. In the query strings that have values it prints the lists just fine, they don't have this if clause, just the print command.
If there is an empty set, it prints a blank row in a table (i.e., a row with height of 0. We want to make it print a string when there are no results for that province).
Here's an example snippit, with the table formatting tags removed:
I've also tried
I've experimented with COUNT but couldn't get it figured out.
This is really bugging me
YT = Yukon. I have a separate (I know it's inefficient, but I don't particularly mind this time) SELECT for each province. In the query strings that have values it prints the lists just fine, they don't have this if clause, just the print command.
If there is an empty set, it prints a blank row in a table (i.e., a row with height of 0. We want to make it print a string when there are no results for that province).
Here's an example snippit, with the table formatting tags removed:
Code:
$resultID = mysql_query($queryStringYT, $linkID);
while(list($groupID, $groupName) = mysql_fetch_row($resultID))
{
if ($groupID == "") then print "empty";
else print "$groupID, $groupName";
}
I've also tried
Code:
$resultID = mysql_query($queryStringYT, $linkID);
while(list($groupID, $groupName) = mysql_fetch_row($resultID))
{
if (mysql_field_len($resultID, 'groupID') == 0) print "nope";
else print "$groupID, $groupName";
}
I've experimented with COUNT but couldn't get it figured out.
This is really bugging me