On 18/09/15 00:14, Rowan Collins wrote: > On 17/09/2015 23:45, Lester Caine wrote: >> The 'does not exist' requires that there IS a second field to carry the >> flag that 'MOT' is not required, while simply leaving it out of the >> result set then saves two fields. > > I'm confused - do you mean that some rows in the result set from the > database have columns "missing", rather than just set to NULL? That's > not something I've ever come across before.
While it would be better SQL practice to list all fields used in the result set, '*' will return 'all fields' which are visible and may indeed have 'missing fields'. > By the way, you still haven't addressed my point about this whole setup > only giving you 3 states, and there being no particular reason you won't > need a 4th later. For this particular method of working which is perhaps 20 years old, there are only three states. If the field exists in the result set, if it's null and if it has a value. >> Currently one has to switch off errors where is_null may be used with a >> non-existent field > > Why? That's what isset() is for, which is where this whole discussion > started; I'm not sure why you've suddenly mentioned is_null(). But the whole problem here is that isset does NOT identify that the result set has fields that are NULL. The point everybody has been making is that we need something that returns true for isset AND is_null, unless you have some other method of identifying that the variable exists before calling is_null ? >> Deprecate expand() so it's use is not possible may be another 'fix'? > > Surely there are plenty of ways to use extract() without attempting to > give meaning to missing variables. So similarly there are plenty of ways of using null field variables if extract() has created them. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php