svn: /phpdoc/en/trunk/reference/array/functions/ list.xml

From: Date: Wed, 27 Feb 2013 04:10:21 +0000
Subject: svn: /phpdoc/en/trunk/reference/array/functions/ list.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-11041@lists.php.net to get a copy of this message
frozenfire Wed, 27 Feb 2013 04:10:21 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=329580 Log: Changed list function example to use ext/PDO instead of ext/MySQL. Closes bug #64288. Bug: https://bugs.php.net/64288 (Open) Deprecated ext/mysql should not be used as an example Changed paths: U phpdoc/en/trunk/reference/array/functions/list.xml Modified: phpdoc/en/trunk/reference/array/functions/list.xml =================================================================== --- phpdoc/en/trunk/reference/array/functions/list.xml 2013-02-25 21:46:06 UTC (rev 329579) +++ phpdoc/en/trunk/reference/array/functions/list.xml 2013-02-27 04:10:21 UTC (rev 329580) @@ -82,9 +82,8 @@ </tr> <?php - -$result = mysql_query("SELECT id, name, salary FROM employees", $conn); -while (list($id, $name, $salary) = mysql_fetch_row($result)) { +$result = $pdo->query("SELECT id, name, salary FROM employees"); +while (list($id, $name, $salary) = $result->fetch(PDO::FETCH_NUM)) { echo " <tr>\n" . " <td><a href=\"info.php?id=$id\">$name</a></td>\n" . " <td>$salary</td>\n" .

« previous php.doc.cvs (#11041) next »