PHP variables from mysql table

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Richard

    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("S ELECT Group_Name FROM `groups` where
    ".$section."_co mment like '%".$day."%' and ".$section."_co mment like
    '%mixed%'");
    echo "<u>Open to Boys & Girls</u></br>";
    while($row = mysql_fetch_arr ay( $result )) {
    $Group_Name = $row['Group_Name'];
    echo "&bull; ".$Group_Name." </br>";
    }// end Group Name loop mixed

    Regards

    Richard
  • Geoff Berrow

    #2
    Re: PHP variables from mysql table

    I noticed that Message-ID:
    <ab23a154.05022 50510.89c6843@p osting.google.c om> from Richard contained
    the following:
    [color=blue]
    >Code is below, does anyone have any ideas?[/color]

    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/

    Comment

    Working...