|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-01-18 16:48 UTC] alcofora at netmake dot com dot br
Description:
------------
The same problem that happend with PHP 4.4.1 and was reported on ticket ID# 35536.
Its was solved for php 4.4.1 but is back again on php 4.4.2 the has been launched last day 13.
When we call 'mysql_field_type' for a decimal field it return as 'unknown'.
Please look this.
Reproduce code:
---------------
<?php
/*
CREATE TABLE `test` (
`fielda` int(11) NOT NULL,
`fieldb` decimal(10,3) default NULL,
PRIMARY KEY (`fielda`)
);
*/
mysql_connect("localhost:3306", "root", "123");
mysql_select_db("test");
$result = mysql_query("SELECT * FROM test");
$fields = mysql_num_fields($result);
$rows = mysql_num_rows($result);
$table = mysql_field_table($result, 0);
echo "Your '" . $table . "' table has " . $fields . " fields and " . $rows . " record(s)\n";
echo "The table has the following fields:\n";
for ($i=0; $i < $fields; $i++) {
$type = mysql_field_type($result, $i);
$name = mysql_field_name($result, $i);
$len = mysql_field_len($result, $i);
$flags = mysql_field_flags($result, $i);
echo $type . " " . $name . " " . $len . " " . $flags . "\n";
}
mysql_free_result($result);
mysql_close();
?>
Expected result:
----------------
Your 'test' table has 2 fields and 0 record(s) The table has the following fields: int fielda 11 not_null primary_key real fieldb 12
Actual result:
--------------
Your 'test' table has 2 fields and 0 record(s) The table has the following fields: int fielda 11 not_null primary_key unknown fieldb 12 not_null
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
Hi, Now i'm using PHP 5.1.2 and MySQL Support enabled Active Persistent Links 0 Active Links 0 Client API version 5.0.16 I'm using libmysql.dll that comes from MySQL5. The problem with decimal still happening.