Re: database driver: no more rows

From: Date: Thu, 23 Oct 2003 13:27:15 +0000
Subject: Re: database driver: no more rows
Groups: php.internals 
Request: Send a blank email to internals+get-4941@lists.php.net to get a copy of this message
Alle 15:02, giovedì 23 ottobre 2003, Lukas Smith ha scritto: > > . run query 1 > > . check if q1 worked > > . run query 2 > > . check if q2 worked > > . if q1 worked -> fetch data > > > > ...and so on. > > > > Perhaps I'm missing something, but I can't see a real issue here. > > Yeah, you are missing something :-/ [...] > The other alternative would be to remember the last error and check > if that error is the same every time you check and all such solutions > are possible but very hacky of course. Well, I didn't miss anything :) What you call hacky is the way I usually work: do something, check if there was an error; if so, collect the error, else (or then) go on. I don't want to be polemical, only I can't see anything wrong (if you need the mysql_error()) in doing something like: . run query 1 . check if q1 worked . if not -> q1_error = mysql_error() . run query 2 . check if q2 worked . if not -> q2_error = mysql_error() . if q1 worked -> fetch data It's obvious that I am no-one in the php decisional process ;) I think that your proposal would be more elegant than the way things are now; it would be also better, if it didn't break bc with ways of programming that are commonly in use. Again: no polemical spirit :) Ciao ce -- Cesare D'Amico - http://www.phpday.it "E` un'emergenza!!! Dovrei fare questo-e-questaltro ma non posso perche' la mia testa e` piena di segatura e criceti!!!" -- un utente [ http://www.soft-land.org/storie/ ]

« previous php.internals (#4941) next »