[Phplib-trackers] [ phplib-Support Requests-518253 ] Suggestion: more shortcuts
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-02-16 00:36:22
|
Support Requests item #518253, was opened at 2002-02-15 16:36 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403612&aid=518253&group_id=31885 Category: None Group: None Status: Open Priority: 5 Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: Suggestion: more shortcuts Initial Comment: Having used PHPlib since v5? I 'd like to suggest some addtions to the DB wrapper classes since I use these almost exclusively now: /* query->fetch, a onestep shortcut for single row queries returns the number of rows so it can be used in if statements */ function qf($query) { $this->query($query); $this->next_record(); return $this->num_rows(); } /* query - make the query, return the number of rows */ function numquery($query) { $this->query($query); return $this->num_rows(); } /* returns number of affected rows after the query is made can be used in if statements true/false */ function truequery($query) { $this->query($query); return $this->affected_rows(); } /* returns queryID after the query is made - Silent suppresses any mysql errors */ function silentquery($query) { $this->Silent=1; $this->query($query); return $this->Query_ID(); } /* returns queryID affter the query is made */ function lockquery($query, $table) { $this->lock($table); $this->query($query); $this->unlock(); return $this->affected_rows(); } /* returns the 'fetch array' row - handy for sinlge 'gets'*/ function getRow() { $this->next_record(); return $this->Record; } ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403612&aid=518253&group_id=31885 |