Re: php isn't displaying mysql query correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Apr 17, 2009 at 10:23 PM, Shawn McKenzie <nospam@xxxxxxxxxxxxx>wrote:

> Adam Williams wrote:
> > Shawn McKenzie wrote:
> >>
> >> No.  How about:
> >>
> >> while ($row = mysqli_fetch_array($mysqli_get_support_types_result))
> >>        {
> >>        echo "<option>".$row['types'];
> >>        }
> >>
> >>
> >
> > thanks, now that you provided that, I see that I left out the $row
> > variable!
> >
>
> And for the explanation, you set $mysqli_get_support_types = "Select
> types from support_types order by types";
>
> So when you echoed $mysqli_get_support_types[types], and it wasn't an
> array and PHP didn't know what types was, it gave you the
>  0 index of the string which is S.
>
>
And next time before complaining if you do  echo  print_r($variable)  or
echo var_dump($variable)
would save you lots of headaches :)

Lenin

www.twitter.com/nine_L

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux