Home Tutorial Php Phppdo Tutorial PDO Fetch Lazy


Share on Google+Share on Google+
PDO Fetch Lazy
Posted on: April 5, 2010 at 12:00 AM
In this tutorial we will study about PDO Fetch Lazy method in PHP, how to access MySQL using PDO Fetch Lazy method , How to retrieve data etc. Examples will make this clearer.

PDO Fetch Lazy:

PDO::FETCH_LAZY is the combination of PDO::FETCH_OBJ and PDO::FETCH_BOTH. It displays the query which has been made along with the object variable names as they are accessed. Following  example illustrates the idea, and as you see the output, you will find the it displays the query and the field names and their respective values.









$dbh=new PDO("mysql:host=$hostname;dbname=ajax",$user,$password);

$sql="select * from student";






catch(PDOException $c)


echo $c->getMessage();





PDORow Object
    [queryString] => select * from student
    [name] => neeraj
    [roll] => 2

Related Tags for PDO Fetch Lazy:

Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: April 5, 2010

Recommend the tutorial

Advertisements Advertisements