[Phplib-trackers] [ phplib-Support Requests-518253 ] Suggestion: more shortcuts
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-08-04 07:16:32
|
Support Requests item #518253, was opened at 2002-02-16 11:36 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403612&aid=518253&group_id=31885 Category: None Group: None >Status: Closed 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; } ---------------------------------------------------------------------- Comment By: Ignatius Teo (eyrie) Date: 2002-08-04 17:11 Message: Logged In: YES user_id=29397 Thank you for your contributions, we will shortly be reviewing v7.4x in light of future developments for v8 and if warranted, we may include your suggestions in the distro. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403612&aid=518253&group_id=31885 |