ID:               42619
 Comment by:       uwendel at mysql dot com
 Reported By:      lmanseau at claurendeau dot qc dot ca
 Status:           Open
 Bug Type:         MySQLi related
 Operating System: Linux
 PHP Version:      5.2.4
 New Comment:

Please provide a reproducible test case, including SQL definitions and
"the other statements" you mention, if they are needed for a minimum
test case.

Thanks!


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

[2007-09-10 20:50:48] lmanseau at claurendeau dot qc dot ca

Description:
------------
I try to execute a prepared statement with mysqli. I use PHP 5.2.0 with
MySQL 5.0.27

After some tests, prepared statements with MySQL instructions  such as
(INSERT, DELETE and UPDATE) work very well.

The only case problem which I pointed out, it is the instruction SELECT
that does not seem to react of good manner

-       SELECT * FROM table1 – don’t work
-       SELECT C1, C2 FROM table1 - don’t work

I have no error message!!!

Reproduce code:
---------------
$db = new mysqli($hote, $util, $mpas, $base);  
if (!$db) { 
   echo "No connection with BD"; 
   exit(); 
} 

//WORK WELL 
echo 'Non prepared statement<br />'; 
$sql = "select * from ch9books";  
$rqp = $db->query($sql);  
echo 'books = '.$rqp->num_rows.'<br />'; 


//DON’T WORK
echo '<br />Prepared statement<br />'; 
$sql = "select * from ch9books";  
$rqp = $db->prepare($sql); 
$rqp->execute(); 
echo 'books = '.$rqp->num_rows.'<br />'; 

$rqp->close();


Expected result:
----------------
Non prepared statement
Books = 6 



Actual result:
--------------
Prepared statement 
Books = 0



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


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

Reply via email to