PHP variables from mysql table

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-25-2005
Richard
 
Posts: n/a
Default PHP variables from mysql table

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 "&bull; ".$Group_Name."</br>";
}// end Group Name loop mixed

Regards

Richard
Reply With Quote
  #2 (permalink)  
Old 02-25-2005
Geoff Berrow
 
Posts: n/a
Default Re: PHP variables from mysql table

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/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:54 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0