hi,
i think there is an error in the html part:
$drop_down_list .= "<optionvalue=$aviao>$aviao</option>";
^
should that not be?:
$drop_down_list .= "<option value='$aviao'>$aviao</option>";
HTH
t.
> -----Message d'origine-----
> De : Miguel Br�s [mailto:[EMAIL PROTECTED]
> Envoy� : lundi 24 f�vrier 2003 11:04
> � : Ernest E Vogelsinger
> Cc : [EMAIL PROTECTED]
> Objet : Re: [PHP] What is wrong with this?
>
>
> Hi,
>
> yes in fact it worked...I also had the $numrows with wrong mysql command, it
> should be mysql_num_rows() instead of the mysql_fetch_rows().
> Thx Ernest
>
> But now that this is working, i have another big problem...my
> $drop_down_list isn't assuming the value of the shown option...right here on
> the below part
>
> ********
> for ($i = 0; $i < $num; $i++) {
> $aviao = mysql_result($resultaviao, $i, "aviao");
> $sk = mysql_result($resultaviao, $i, "sk");
> $drop_down_list .= "<optionvalue=$aviao>$aviao</option>";
> }
> **********
>
> So he isn't getting the data from DB. He displays all records on DB
> available at aviao field, but he is not making the correct mysql query...
>
> Anyone knows why?
>
> ----- Original Message -----
> From: "Ernest E Vogelsinger" <[EMAIL PROTECTED]>
> To: "Miguel Br�s" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, February 24, 2003 9:45 AM
> Subject: Re: [PHP] What is wrong with this?
>
>
> At 10:37 24.02.2003, Miguel Br�s said:
> --------------------[snip]--------------------
> >//logical request
> >if ($nome) {
> >$sql="aviao = '$nome' ";
> >}
> >if ($code) {
> >$sql="code = '$code' ";
> >}
> > $query = "SELECT * FROM ssr WHERE";
> > $query .= $sql;
> --------------------[snip]--------------------
>
> Hi,
>
> I've copied only the relevant lines of your program.
>
> The issue here is that your string concatenation results in
> SELECT * FROM ssr WHEREaviao = 'Airbus'
>
> Note the missing space after "WHERE". Your code should better read
> $query = "SELECT * FROM ssr WHERE ";
> $query .= $sql;
> Have an eye on the added blank after WHERE.
>
> HTH,
>
> --
> >O Ernest E. Vogelsinger
> (\) ICQ #13394035
> ^ http://www.vogelsinger.at/
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php