|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79581 see the desc and test script
Submitted: 2020-05-10 19:14 UTC Modified: 2020-05-10 21:56 UTC
From: aguest1618 at protonmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS: doesn't matter
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: aguest1618 at protonmail dot com
New email:
PHP Version: OS:


 [2020-05-10 19:14 UTC] aguest1618 at protonmail dot com
From manual page:
Example #1 Easy migration from the old mysql extension
$mysqli = mysqli_connect("", "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("", "user", "password");
$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 ?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-05-10 21:56 UTC]
-Status: Open +Status: Not a bug
 [2020-05-10 21:56 UTC]
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.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 04:03:37 2021 UTC