Re: [PHP] mysqli bind_param and store_result don't work well together
On 1/5/06, Curt Zirzow [EMAIL PROTECTED] wrote: On Wed, Jan 04, 2006 at 12:31:02AM +0530, anirudh dutt wrote: hi the subject is pretty much what the problem is. if i use $st1 = $sql-stmt_init(); // $sql is a mysqli obj/conn $st1-prepare(select `num` from `activity` where `id` = ?); $st1-bind_param('s', $myid); $myid = '3f6d017d3e728b057bcc082a7db75a57'; // forcing value to check ... gives rows: 0, num: 0 ... also, if i use an sql var in the prepare/bind case as $st1-prepare(select @ck_num:=`num` from `activity` where `id` = ?); var_dump($rz) is NULL; otherwise it's int(7) What version of php and mysql do you have? Curt. php 5.0.3 mysql 4.1.14-nt Apache/2.0.50 (Win32) anirudh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysqli bind_param and store_result don't work well together
On Sat, Jan 14, 2006 at 03:18:55AM +0530, anirudh dutt wrote: On 1/5/06, Curt Zirzow [EMAIL PROTECTED] wrote: On Wed, Jan 04, 2006 at 12:31:02AM +0530, anirudh dutt wrote: hi the subject is pretty much what the problem is. if i use $st1 = $sql-stmt_init(); // $sql is a mysqli obj/conn $st1-prepare(select `num` from `activity` where `id` = ?); $st1-bind_param('s', $myid); $myid = '3f6d017d3e728b057bcc082a7db75a57'; // forcing value to check ... gives rows: 0, num: 0 ... also, if i use an sql var in the prepare/bind case as $st1-prepare(select @ck_num:=`num` from `activity` where `id` = ?); var_dump($rz) is NULL; otherwise it's int(7) What version of php and mysql do you have? Curt. php 5.0.3 I would take in consideration that: - 5.0.3 was realease prior to March 31, 2005 - 5.0.4 was realease on March 31, 2005 - 5.0.5 was released on Sep 06, 2005. - 5.1.0 was release on Nov, 24, 2005 - 5.1.1 was release on Nov, 28, 2005 - 5.1.2 was release on Jan 12, 2006 And considering that any new release of any new version is prone to serveral bugs; toward a more stable system as time passes. The version you have is almost a year old. Not to mention the stable releases are being issued on 5.1.x now. wow, with that timetable, i just have to say.. happy new year to everyone!! time goes by so fast. Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysqli bind_param and store_result don't work well together
On Wed, Jan 04, 2006 at 12:31:02AM +0530, anirudh dutt wrote: hi the subject is pretty much what the problem is. if i use $st1 = $sql-stmt_init(); // $sql is a mysqli obj/conn $st1-prepare(select `num` from `activity` where `id` = ?); $st1-bind_param('s', $myid); $myid = '3f6d017d3e728b057bcc082a7db75a57'; // forcing value to check ... gives rows: 0, num: 0 ... also, if i use an sql var in the prepare/bind case as $st1-prepare(select @ck_num:=`num` from `activity` where `id` = ?); var_dump($rz) is NULL; otherwise it's int(7) What version of php and mysql do you have? Curt. -- cat .signature: No such file or directory -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysqli bind_param and store_result don't work well together
hi the subject is pretty much what the problem is. if i use $st1 = $sql-stmt_init(); // $sql is a mysqli obj/conn $st1-prepare(select `num` from `activity` where `id` = ?); $st1-bind_param('s', $myid); $myid = '3f6d017d3e728b057bcc082a7db75a57'; // forcing value to check $st1-execute(); $st1-store_result(); $st1-bind_result($rz); $st1-fetch(); echo rows: {$st1-num_rows}, ; echo num: $rz; gives rows: 0, num: 0 but if i use this prepare instead (without the bind_param and value inserted) $st1-prepare(select `num` from `activity` where `id` = '3f6d017d3e728b057bcc082a7db75a57'); i get rows: 1, num: 7 (the correct result) if i use $st1 = $sql-prepare... instead of stmt_init(), the results are identical. is this a bug with bind_param or is it supposed to this way? also, if i use an sql var in the prepare/bind case as $st1-prepare(select @ck_num:=`num` from `activity` where `id` = ?); var_dump($rz) is NULL; otherwise it's int(7) any ideas? anirudh -- ]# Anirudh Dutt ...pilot of the storm who leaves no trace like thoughts inside a dream -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php