note 108073 deleted from sqlite3.querysingle by danbrown

From: Date: Tue, 27 Mar 2012 15:33:32 +0000
Subject: note 108073 deleted from sqlite3.querysingle by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-186849@lists.php.net to get a copy of this message
Note Submitter: Sascha ---- You ask, what this method is good for – it's just for convenience. Compare these examples: // readable, short, nice... $name = $db->querySingle ("SELECT name FROM persons WHERE id = 1"); // well, ask yourself... :) $res = $db->query ("SELECT name FROM persons WHERE id = 1"); $row = $res->fetchArray (SQLITE3_NUM); $name = $row [0]; // a bit shorter, but even not the optimal way $res = $db->query ("SELECT name FROM persons WHERE id = 1"); list ($name) = $res->fetchArray (SQLITE3_NUM);

« previous php.notes (#186849) next »