On Sun, 19 Jan 2003 00:21:30 +0100 alex <[EMAIL PROTECTED]> wrote: > > I hope you aren't depending on $rv4 to tell you whether a select > > found any rows. The return value from execute() is not generally a > > dependable row count for SELECT statements. > > oh - why not? i have tryed with a debug line and i've tested this... of no > match is found i will get 0E0 back and if one is found it will give me 1 > back... should i change this? how - what is bedder?
It would be better to actually fetch a row to see if any are available. What you have apparently works for mysql, but it will be a very hard to track down bug if you try the same thing with most other databases. >From the fine manual (http://xmlproj.com/fom-serve/cache/49.html): For SELECT statements, execute simply "starts" the query within the database engine. Use one of the fetch methods to retreive the data after calling execute. The execute method does not return the number of rows that will be returned by the query (because most databases can't tell in advance), it simply returns a true value. -- 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.
