note 72258 added to function.mysqli-fetch-object

From: Date: Tue, 09 Jan 2007 21:51:57 +0000
Subject: note 72258 added to function.mysqli-fetch-object
Groups: php.notes 
Request: Send a blank email to php-notes+get-121506@lists.php.net to get a copy of this message
A less verbose example of the OO style usage: (Add your own error checking) <?php // make mysqli DB connection $db = mysqli('localhost', 'username', 'password', 'mydb'); // write the query string to a variable $sql = "SELECT fname, lname FROM users WHERE uid = 4 LIMIT 1"; // run the query, returns result object $res = $db->query($sql); // return row as object $row = $res->fetch_object; // access query values in OO fashion echo 'The user\'s name is '.$row->fname.' '.$row->lname.'<br />'; ?> ---- Server IP: 66.163.161.117 Probable Submitter: 71.62.25.178 ---- Manual Page -- http://www.php.net/manual/en/function.mysqli-fetch-object.php Edit -- https://master.php.net/note/edit/72258 Del: integrated -- https://master.php.net/note/delete/72258/integrated Del: useless -- https://master.php.net/note/delete/72258/useless Del: bad code -- https://master.php.net/note/delete/72258/bad+code Del: spam -- https://master.php.net/note/delete/72258/spam Del: non-english -- https://master.php.net/note/delete/72258/non-english Del: in docs -- https://master.php.net/note/delete/72258/in+docs Del: other reasons-- https://master.php.net/note/delete/72258 Reject -- https://master.php.net/note/reject/72258 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#121506) next »