[PHP-DEV] Bug #743 Updated: fields wrongly parsed when Decimal(x,x) defined in table From: Bug Database (php-dev <email protected>)
Date: 09/22/98

ID: 743
Updated by: zeev
Reported By: analyzer <email protected>
Status: Closed
Bug Type: MySQL related
Assigned To:
Comments:

This script makes no sense. I've fixed it up and it works
exactly as expected:

<?

$MY = mysql_connect(...);
mysql_select_db("foo",$MY);

function ProductForm($productid) {
 global $MY;

 $res = mysql_list_fields("foo", "bar") or die(mysql_error());
 $fieldsnr = mysql_num_fields($res);

 echo '<TABLE BORDER="0">';

 for($i=0; $i < $fieldsnr; $i++) {
   $fname = mysql_field_name($res,$i);
   $flength = mysql_field_len($res, $i);
   echo "<TR><TD>$fname $flength</TD>\n";
        "</TR>";
 }

 echo '</TABLE>';
}

ProductForm("blah");

?>

Full Bug description available at: http://ca.php.net/bugs.php3?id=743

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>