ID:               40870
 Updated by:       [EMAIL PROTECTED]
 Reported By:      key88sf at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQLi related
 Operating System: Windows Vista
 PHP Version:      5.2.1
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:
------------------------------------------------------------------------

[2007-03-20 19:26:42] key88sf at gmail dot com

Description:
------------
I have a simple stored procedure in MySQL 5.x. The proc first does a
SELECT INTO query, followed by a regular SELECT to return it's result
set.

The SELECT INTO generates a warning 1329 because no rows were fetched.
However, the final SELECT works properly and returns 1 row.

However, the result returned from mysqli_query() is NULL !


Reproduce code:
---------------
Stored proc is this:

  DECLARE v_affiliate_id INTEGER DEFAULT NULL;

  -- This SELECT INTO returns 0 rows:
  select
        affiliate_id INTO v_affiliate_id 
  from 
        affiliates 
  where 
        user_name = v_user_name 
        and password_hash = v_password_hash;

  if ( v_affiliate_id IS NULL ) THEN
    SET v_affiliate_id := -1;
  end if;

  -- This is the result set row:
  select v_affiliate_id;


Expected result:
----------------
When I run this from the MySQL command line, I get 1 row, 1 warning
(1329).

When I run from PHP, I *expect* to see a result set with 1 row.

Actual result:
--------------
When I run from PHP, the result set from mysqli_query() is NULL.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40870&edit=1

Reply via email to