Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.0

Bug #3691 mssql: tableInfo - no propertys for flags
Submitted: 2005-03-03 17:08 UTC
From: mail at fzietlow dot de Assigned: danielc
Status: Closed Package: DB
PHP Version: 4.3.9 OS: Linux (Apache 2.0.48)
Roadmaps: (Not assigned)    

 [2005-03-03 17:08 UTC] mail at fzietlow dot de
Description: ------------ i like to get some informations of fields from some tables on a mssql database. the most ist quite good but te info of the flag field isn't correct. the function _mssql_field_flags become only the table name (both two parameters). the second shoud be the fieldname... and sorry for this englisch... ;) Reproduce code: --------------- for ($i = 0; $i < $count; $i++) { $field_name = $case_func(@mssql_field_name($id, $i)); $res[$i] = array( 'table' => $got_string ? $case_func($result) : '', 'name' => $field_name, 'type' => @mssql_field_type($id, $i), 'len' => @mssql_field_length($id, $i), // We only support flags for table 'flags' => $got_string ? $this->_mssql_field_flags($result, $case_func($field_name)) : '', ); Expected result: ---------------- the right flags of a field. like primary_key, auto_increment... Actual result: -------------- -


 [2005-03-03 17:13 UTC] mail at fzietlow dot de
The Actual result: ----------------- There are some strange results of the fields. the result is correct if the field name equal table name but this is only one of a table... [:
 [2005-03-03 17:17 UTC] mail at fzietlow dot de
And... Under "Reproduce code:" is the solution - it's a little bug. This must pased on mssql.php line 747.
 [2005-03-07 18:30 UTC] danielc
Fixed in latest release (1.7.4). Thanks for your report. For future reference, the "Reproduce Code" section is for a short test script that anyone can use to reproduce the error you are experiencing. For example: <?php $db->query('CREATE TABLE blah (a integer NOT NULL)'); $db->query('INSERT INTO blah VALUES (5)'); $res =& $db->query('SELECT a FROM blah'); echo "from result:\n"; print_r($db->tableInfo($res)); echo "from table name:\n"; print_r($db->tableInfo('blah')); $db->query('DROP TABLE blah');