|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28925 MYSQLI_UNIQUE_KEY_FLAG not found on UNIQUE indexes
Submitted: 2004-06-25 17:11 UTC Modified: 2004-08-11 14:51 UTC
From: danielc at analysisandsolutions dot com Assigned: georg (profile)
Status: Not a bug Package: MySQL related
PHP Version: 5CVS-2004-06-25 (dev) OS: Windows 2000
Private report: No CVE-ID: None
 [2004-06-25 17:11 UTC] danielc at analysisandsolutions dot com
MYSQLI_UNIQUE_KEY_FLAG aren't being indicated for columns that have UNIQUE indexes.

Reproduce code:
             'CREATE TABLE phptest_fk (a VARCHAR(5),' .
             ' UNIQUE (a))');

$r = mysqli_query($db->connection,
                  'SELECT a FROM phptest_fk');

$tmp = mysqli_fetch_field($r);
if ($tmp->flags & MYSQLI_UNIQUE_KEY_FLAG) {
    echo "yes\n";
} else {
    echo "no\n";

             'DROP TABLE phptest_fk');

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-11 14:51 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Currently the resultset sent from server to client doesn't contain this flag anymore.

Not sure if it will be implemented again (if not I will remove it from PHP)
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 24 20:03:41 2023 UTC