mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-16 00:48:54 +00:00
Use preferred comment style in examples.
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@194305 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
parent
086aa9f025
commit
afd947e79a
3 changed files with 15 additions and 15 deletions
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.13 $ -->
|
||||
<!-- $Revision: 1.14 $ -->
|
||||
<refentry id="function.PDO-construct">
|
||||
<refnamediv>
|
||||
<refname>PDO::__construct</refname>
|
||||
|
@ -130,7 +130,7 @@
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Connect to an ODBC database using driver invocation
|
||||
/* Connect to an ODBC database using driver invocation */
|
||||
$dsn = 'mysql:dbname=testdb;host=127.0.0.1';
|
||||
$user = 'dbuser';
|
||||
$password = 'dbpass';
|
||||
|
@ -165,7 +165,7 @@ odbc:DSN=SAMPLE;UID=john;PWD=mypass
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Connect to an ODBC database using driver invocation
|
||||
/* Connect to an ODBC database using driver invocation */
|
||||
$dsn = 'uri:file:///usr/local/dbconnect';
|
||||
$user = '';
|
||||
$password = '';
|
||||
|
@ -193,7 +193,7 @@ pdo.dsn.mydb="mysql:dbname=testdb;host=localhost"
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Connect to an ODBC database using an alias
|
||||
/* Connect to an ODBC database using an alias */
|
||||
$dsn = 'mydb';
|
||||
$user = '';
|
||||
$password = '';
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="iso-8859-1"?>
|
||||
<!-- $Revision: 1.2 $ -->
|
||||
<!-- $Revision: 1.3 $ -->
|
||||
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.PDOStatement-closeCursor">
|
||||
<refnamediv>
|
||||
|
@ -101,22 +101,22 @@ do {
|
|||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Create a PDOStatement object
|
||||
/* Create a PDOStatement object */
|
||||
$stmt = $dbh->prepare('SELECT foo FROM bar');
|
||||
|
||||
// Create a second PDOStatement object
|
||||
/* Create a second PDOStatement object */
|
||||
$stmt = $dbh->prepare('SELECT foobaz FROM foobar');
|
||||
|
||||
// Execute the first statement
|
||||
/* Execute the first statement */
|
||||
$stmt->execute();
|
||||
|
||||
// Fetch only the first row from the results
|
||||
/* Fetch only the first row from the results */
|
||||
$stmt->fetch();
|
||||
|
||||
// The following call to closeCursor() may be required by some drivers
|
||||
/* The following call to closeCursor() may be required by some drivers */
|
||||
$stmt->closeCursor();
|
||||
|
||||
// Now we can execute the second statement
|
||||
/* Now we can execute the second statement */
|
||||
$otherStmt->execute();
|
||||
?>
|
||||
]]>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version='1.0' encoding='iso-8859-1'?>
|
||||
<!-- $Revision: 1.7 $ -->
|
||||
<!-- $Revision: 1.8 $ -->
|
||||
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
|
||||
<refentry id="function.PDOStatement-rowCount">
|
||||
<refnamediv>
|
||||
|
@ -76,16 +76,16 @@ Deleted 9 rows.
|
|||
$sql = "SELECT COUNT(*) FROM fruit WHERE calories > 100";
|
||||
if ($res = $conn->query($sql)) {
|
||||
|
||||
// Check the number of rows that match the SELECT statement
|
||||
/* Check the number of rows that match the SELECT statement */
|
||||
if ($res->fetchColumn() > 0) {
|
||||
|
||||
// Issue the real SELECT statement and work with the results
|
||||
/* Issue the real SELECT statement and work with the results */
|
||||
$sql = "SELECT name FROM fruit WHERE calories > 100";
|
||||
foreach ($conn->query($sql) as $row) {
|
||||
print "Name: " . $row['NAME'] . "\n";
|
||||
}
|
||||
}
|
||||
// No rows matched -- do something else
|
||||
/* No rows matched -- do something else */
|
||||
else {
|
||||
print "No rows matched the query.";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue