This is a discussion on PHP variables from mysql table within the PHP Language forums, part of the PHP Programming Forums category; Hi I have a PHP script which parces a mySQL table and shows which sections meet on which day by ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi
I have a PHP script which parces a mySQL table and shows which sections meet on which day by using an array containing (mon,...Fri) and another lisitng sections. I then have the PHP do to selecrt statements on to list those sections that are mixed and those that are not. I have a title "Open to Boys and Girls" then it cycles through the applicable groups. I want to hide this title if there are no group from the mysql search but can't figure out how as the actual varaible $result is set once the search is done even if it pulls nothing back Code is below, does anyone have any ideas? CODE ------------------------------------------- $result = @mysql_query("SELECT Group_Name FROM `groups` where ".$section."_comment like '%".$day."%' and ".$section."_comment like '%mixed%'"); echo "<u>Open to Boys & Girls</u></br>"; while($row = mysql_fetch_array( $result )) { $Group_Name = $row['Group_Name']; echo "• ".$Group_Name."</br>"; }// end Group Name loop mixed Regards Richard |
|
|||
|
I noticed that Message-ID:
<ab23a154.0502250510.89c6843@posting.google.com> from Richard contained the following: >Code is below, does anyone have any ideas? Check if mysql_numrows($result) is greater than zero -- Geoff Berrow (put thecat out to email) It's only Usenet, no one dies. My opinions, not the committee's, mine. Simple RFDs http://www.ckdog.co.uk/rfdmaker/ |