[PHP-DB] MYSQLi fetch corrupting bound variables

2011-08-25 Thread Stuart Milne
Hi there Getting a weird issue with MySQLi fetch when using bound variables. First of all here is some example code. ?php $pID = 0; $recordID = 0; if ($stmt = $dbObj-prepare('SELECT `id`, name FROM MYTABLE WHERE id = ?) { if ($stmt-bind_param('i', $pID)) { if ($stmt-bind_result($recordID,

[PHP-DB] Re: MYSQLi fetch corrupting bound variables

2011-08-25 Thread Jim Giner
First glance: your 'if' needs '= =' not '=' -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DB] Re: MYSQLi fetch corrupting bound variables

2011-08-25 Thread Richard Quadling
On 25 August 2011 14:07, Jim Giner jim.gi...@albanyhandball.com wrote: First glance:  your 'if' needs '= ='  not '=' No. Fully ... if (False !== ($stmt = $dbObj-prepare(...))) { ... } In PHP, assignments evaluate to the value assigned. If the value assigned can be evaluated as TRUE then the