From:             
Operating system: win 2003
PHP version:      Irrelevant
Package:          Apache2 related
Bug Type:         Bug
Bug description:mysql_result() can't return ''

Description:
------------
---

>From manual page: http://www.php.net/function.mysql-result

---

Test script:
---------------
<?php

  // my php version:5.3.1

  $conn = mysql_connect("127.0.0.1", "root", "root") or
die(mysql_error());

  mysql_select_db("mydb", $conn) or die(mysql_error());

  $query = mysql_query("SELECT `desc` FROM `user` WHERE `id`=2", $conn) or
die(mysql_error());

  $desc = mysql_result($query, 0, 0) or die(mysql_error());

  echo "no output<br />";

  echo $desc;

?>

Expected result:
----------------
I think it must return a string '', may be $desc = '';



The fllowing is test database.



CREATE TABLE `user` (

  `id` int(4) NOT NULL AUTO_INCREMENT,

  `name` varchar(20) NOT NULL,

  `desc` tinytext DEFAULT NULL,

  PRIMARY KEY(`id`)

) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;



INSERT INTO `user` VALUES

('u1', ''),

('u2', NULL);


-- 
Edit bug report at http://bugs.php.net/bug.php?id=53278&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=53278&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=53278&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=53278&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=53278&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53278&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=53278&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=53278&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=53278&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=53278&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=53278&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=53278&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=53278&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=53278&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=53278&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=53278&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=53278&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=53278&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=53278&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=53278&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=53278&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=53278&r=mysqlcfg

Reply via email to