Re: php isn't displaying mysql query correctly

From: Date: Fri, 17 Apr 2009 16:01:46 +0000
Subject: Re: php isn't displaying mysql query correctly
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-291631@lists.php.net to get a copy of this message
On Fri, Apr 17, 2009 at 11:41 AM, Adam Williams <awilliam@mdah.state.ms.us>wrote: > I have the code: > > $mysqli_get_support_types = "Select types from support_types order by > types"; > $mysqli_get_support_types_result = > mysqli_query($mysqli,$mysqli_get_support_types) or > die(mysqli_error($mysqli)); > > while (mysqli_fetch_array($mysqli_get_support_types_result)) > { > echo "<option>".$mysqli_get_support_types[types]; > } > echo "</select> > > but when I go to the web page source it displays: > > > > <select><option>S<option>S<option>S<option>S<option>S<option>S<option>S<option>S<option>S<option>S</select> > > but the query runs correctly in MySQL. So why is php just printing S's? > > mysql> Select types from support_types order by types; > +---------------------+ > | types | > +---------------------+ > | Change User | > | Computer Hardware | > | Computer Peripheral | > | Computer Software | > | Delete User | > | Networking | > | New Project | > | New User | > | Server | > | Telephone | > +---------------------+ > 10 rows in set (0.00 sec) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > shoulnd't this echo "<option>".$mysqli_get_support_types[types]; be echo "<option>".$mysqli_get_support_types_result[types]; -- Bastien Cat, the other other white meat

« previous php.general (#291631) next »