RE: [PHP] What am I doing wrong - PHP
| From: | Mike Johnson | Date: | Fri, 12 Nov 2004 21:07:13 +0000 |
| Subject: | RE: [PHP] What am I doing wrong - PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-201874@lists.php.net to get a copy of this message | ||
From: Stuart Felenstein [mailto:stuart4m@yahoo.com]
> Ok, hopefully I can explain this clearly, even though
> I think I might be an idiot since Ive been going on
> about this for a few days.
>
> I have a table that holds values and labels
> i.e. 1 = New York
> 2 = Boston
> 3 = Kansas City
> 4 = Amsterdam
>
> I want to put this table into a multiple selection
> list, that a user can choose from in a form
> My code is drawing a blank though:
>
> //This is my call to the table "staindtypes"
> <?php
> mysql_select_db($database_lokale, $lokale);
> $indque1 = "SELECT * FROM staindtypes";
> $inds = mysql_query($indque1, $lokale) or
> die(mysql_error());
> $row_inds = mysql_fetch_assoc($inds);
> $totalRows_inds = mysql_num_rows($inds);
> $row = mysql_fetch_row;
> ?>
>
>
> //Here is the element and the php to loop it
> <form name="form1" id="form1" method="post"
> action="">
> <select name="Ind" size="5" multiple="multiple"
> id="Ind">
> <option value="">Please Select</option>
> <?php
> do {
> ?>
> <option value="<?php echo
> $rows['CareerIDs']?>"><?php echo
> $row_$result['CareerCategories']?></option>
-------^
I think your error is right here. Don't you want
$rows['CareerCategories']?
Aside from that, I'm not certain the code is exactly what you want, but
this should at least solve the blank page problem. I think PHP's barfing
on that but errors aren't being written to the browser.
Good luck!
--
Mike Johnson Smarter Living, Inc.
Web Developer www.smarterliving.com
mike@smarterliving.com (617) 886-5539