On Thu, 25 Jul 2002 18:22:41 +0300 Hytham Shehab <[EMAIL PROTECTED]> wrote:

>     i got something like that:
> $sth = $dbh->prepare("select id,zone from location order by id");
> $sth = $dbh->execute();
> now the result should be returned - on the web page combo box - like
> this:
> <option value=1>zone1</option>
> <option value=2>zone2</option>
> <option value=3>zone3</option>
> ...
> <option value=n>zonen</option>
> 
> but, guess what, it returned 2 before 1, but when i run it through the
> mysql
> client, it gives me the result i asked for.
> why this happened ?, and how to stop it.

execute() is a statement handle method, not a database handle method.
Read the fine manual (perldoc DBI), it is your friend.

If you want actual answers, show us actual code.  What you have shown us
can't possibly work and you have not shown us how you fetched the results. 
There are lots of ways to undo the ordering of the result set.  Where you
generate the number after 'value=' could also be significant.
-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Reply via email to