Sheridan,

I added the error stuff (adding an else bit) but when I went to my browser,
I got the same resulting error I've always had.

I have tried pasting the select statement striaght into MySQL_Front and I
get my nice neat list. So it doen't look like a SQL problem.

Head banging off wall right now.

George

----- Original Message -----
From: "Sheridan Saint-Michel" <[EMAIL PROTECTED]>
To: "George Pitcher" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, September 26, 2001 4:00 PM
Subject: Re: [PHP] Building Dynamic Value list using ohp


> ----- Original Message -----
> From: "George Pitcher" <[EMAIL PROTECTED]>
> To: "Maxim Maletsky (PHPBeginner.com)" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Wednesday, September 26, 2001 9:42 AM
> Subject: Re: [PHP] Building Dynamic Value list using ohp
>
>
> > Thanks for everyone's help but this is still failing to work.
> >
> > Revised code is:
> >
> > <?php
> > $link = mysql_connect ('localhost', '****', '****')
> >    or die ("Could not select db");
> > mysql_select_db ('Heronsql')
> >    or die ("Could not connect");
> > $query="select distinct HEI from heronuser";
> >    $result = mysql_query ($query); // I've also tried with ($query,
$link)
> >      if(mysql_num_rows($result)) {
> >        // show all HEIs as options in select form
> >        while($row = mysql_fetch_row($result))
> >        {
> >           print("<option value=\"{$row[0]}\">{$row[0]}</option>");
> >        }
> >      }
> > mysql_close($link);
> > ?>
> >
> > Any more suggestions (please)?
> >
> > George
>
> I don't see anything glaringly wrong with your code.
> I would change this:
>
> $result = mysql_query ($query)
>
> into:
>
> if( !($result = mysql_query ($query)) )
>   echo "Error: " . mysql_error() . "<BR>";
>
> as I find that most of my errors in something this simple
> are in something fairly simple with the query itself (misspelled
> table or something).
>
> also make sure that if you copy your query and paste it directly
> into MySQL that it works.
>
> Sheridan Saint-Michel
> Website Administrator
> FoxJet, an ITW Company
> www.foxjet.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to