|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
43 - 11 = ?
Subscribe to this entry?

 [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 06:23:17 2021 UTC