note 83281 added to pdo.prepare

From: Date: Mon, 19 May 2008 05:16:54 +0000
Subject: note 83281 added to pdo.prepare
Groups: php.notes 
Request: Send a blank email to php-notes+get-139510@lists.php.net to get a copy of this message
Using cursors doesn't work with SQLite 3.5.9. I get an error message when it gets to the execute() method. Some of you might be saying "duh!" but i was surprised to see TRIGGER support in SQLite, so i had to try. :) I wanted to use Absolute referencing on a Scrollable cursor and i only wanted one column of data. So i used this instead of a cursor. <?php $dbo = new PDO('sqlite:tdb'); $sql = 'SELECT F1, F2 FROM tblA WHERE F1 <> "A";'; $res = $dbo->prepare($sql); $res->execute(); $resColumn = $res->fetchAll(PDO::FETCH_COLUMN, 0); for($r=0;$r<=3;$r++) echo 'Row '. $r . ' returned: ' . $resColumn[$r] . "\n"; $dbo = null; $res = null; ?> ---- Server IP: 64.71.164.2 Probable Submitter: 24.184.197.151 ---- Manual Page -- http://www.php.net/manual/en/pdo.prepare.php Edit -- https://master.php.net/note/edit/83281 Del: integrated -- https://master.php.net/note/delete/83281/integrated Del: useless -- https://master.php.net/note/delete/83281/useless Del: bad code -- https://master.php.net/note/delete/83281/bad+code Del: spam -- https://master.php.net/note/delete/83281/spam Del: non-english -- https://master.php.net/note/delete/83281/non-english Del: in docs -- https://master.php.net/note/delete/83281/in+docs Del: other reasons-- https://master.php.net/note/delete/83281 Reject -- https://master.php.net/note/reject/83281 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#139510) next »