hi.. listbox prob fixed... i had echo "<select name='user's<br>"; in the first file it should have been: echo "<select name='users'<br>"; and in second file i had: echo 'account[username]........<br>'; should have been : echo "$account[username]......<br>";
----- Original Message ----- From: "Matt" <[EMAIL PROTECTED]> To: "Sunfire" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Sunday, February 02, 2003 4:55 PM Subject: Re: [PHP] listbox problems > >From: "Sunfire" <[EMAIL PROTECTED]> > >Sent: Sunday, February 02, 2003 4:53 PM > >Subject: [PHP] listbox problems > > > > i have a listbox: > > <select name="users"> > > <?php > > //connect to db and get query > > mysql_connect("....."); > > mysql_select_db("..."); > > $query=mysql_query("select username from users); > > /*finish the listbox*/ > > while($account=mysql_fetch_array($query)){ > > echo "<option value=$account[username]>$account[username]<br>"; > > Try: > echo "<option value={$account['username']}"; > $selected = ($account['username'] == $_POST['user']) ? 'selected' : ''; > echo $selected; > echo ">{$account['username']}<br>"; > > > } > > ?> > > </select> > > <input type="submit" value="send"> > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php