|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-09-12 19:27 UTC] sniper@php.net
[2008-10-24 16:07 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 22:00:02 2025 UTC |
Description: ------------ One of the properties returned by msql_fetch_field() is "unique". It is supposed to contain 1 if the column in question is part of a unique key and 0 if it's not. But it always returns 0. Reproduce code: --------------- $con = msql_connect(); $db = msql_select_db('ptdb', $con); msql_query('CREATE TABLE blah (i INT)', $con); msql_query('CREATE UNIQUE INDEX bi ON blah (i)', $con); $result = msql_query('SELECT * FROM blah', $con); $info = msql_fetch_field($result); print_r($info); msql_query('DROP TABLE blah', $con); Expected result: ---------------- stdClass Object ( [name] => i [table] => blah [not_null] => 0 [unique] => 1 [type] => int ) Actual result: -------------- stdClass Object ( [name] => i [table] => blah [not_null] => 0 [unique] => 0 [type] => int )