Re: Count

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

 



Richard,

Thank you so much for your response.

The select would be created from the number of records in the db.

<option value=²$variable²>$variable2</option>

The problem that I am having is rather than getting just the number of
records, which is 3 currently, I would like it to be 1 for the first option,
2 for the second..., so that the user has the choice of any record. The idea
would be to order the content by the highest number.

I hope this makes more sense.

--
Steve M.

on 1/17/08 1:54 PM Richard Heyes (richardh@xxxxxxxxxxx) wrote:

>> > I am wanting to create an select menu for displaying the order of the item
>> > on a page. I am guessing that I need to get the count of how many items are
>> > in the db and them put them into a select menu.
> 
> Your question doesn't really make a great deal of sense. Your SQL could be:
> 
> SELECT COUNT(*) FROM your_table WHERE 1
> 
> Which will give you a single numeric value back (the number of rows). To
> put them into an HTML page:
> 
> <select name="mySelect">
>      <option>Choose...</option>
>      <option value="1">Foo</option>
> </select>
> 
> This is a very basic select. You can simply loop through your query
> results adding more option tags to add more items to the select.



[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