Doc #79581 [Opn->Nab]: see the desc and test script
| From: | requinix@php.net | Date: | Sun, 10 May 2020 21:56:56 +0000 |
| Subject: | Doc #79581 [Opn->Nab]: see the desc and test script | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17560@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79581&edit=1
ID: 79581
Updated by: requinix@php.net
Reported by: aguest1618 at protonmail dot com
Summary: see the desc and test script
-Status: Open
+Status: Not a bug
Type: Documentation Problem
Package: Documentation problem
Operating System: doesn't matter
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Read the code more closely. The first half uses mysqli to SELECT the message
Please, do not use
and outputs it.
Then the second half uses mysql to SELECT the message
the mysql extension for new developments.
and also outputs it.
Previous Comments:
------------------------------------------------------------------------
[2020-05-10 19:14:46] aguest1618 at protonmail dot com
Description:
------------
---
From manual page: https://php.net/mysqli.quickstart.dual-interface
---
Example #1 Easy migration from the old mysql extension
<?php
$mysqli = mysqli_connect("example.com", "user", "password",
"database");
$res = mysqli_query($mysqli, "SELECT 'Please, do not use ' AS _msg FROM DUAL");
$row = mysqli_fetch_assoc($res);
echo $row['_msg'];
$mysql = mysql_connect("example.com", "user", "password");
mysql_select_db("test");
$res = mysql_query("SELECT 'the mysql extension for new developments.' AS _msg FROM
DUAL", $mysql);
$row = mysql_fetch_assoc($res);
echo $row['_msg'];
?>
Test script:
---------------
In Example #1, are the msgs reversed ?
Shouldn't " ... Please do not use ... " be with mysql_connect - the deprecated ver ?
and " ...'the mysqli extension for new developments..." be with mysqli_connect -
the newer recommended ver ?
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79581&edit=1