Re: [DB] Suggestion for field types

From: Date: Mon, 12 Jan 2004 16:45:16 +0000
Subject: Re: [DB] Suggestion for field types
References: 1 2 3 4 5 6 7  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25007@lists.php.net to get a copy of this message
Yes - even if its sometimes wrong, it would be good to have the logic within pear as opposed to every app out there. For example, when creating an edit input, it would be nice to be able to set maxlength from one simple source: eg. ...maxlength=$row[$i]['displaylen']... as opposed to the horrendous: if ($row[$i]['type']) == 'type1') // int2, smallint .... ? len = ?; else if (...type2...) len = ? else if (...datetime... and $informix_flag) // Special handling for datetime length 0x0E0A len = ?; ...etc. etc. else len = $row[$]['type']['length'] Kind regards, Peter Alan Knowles wrote: > > I had a look through this.. strlen is not exactly simple to calculate on > some types.. - (espicially floats) >> maybe > $db->tableInfo('sometable',DB_TABLEINFO_EXTENDED); > could > a) add extra table information > b) do some complex calcs for min/max, str_len etc. >

« previous php.pear.dev (#25007) next »