|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-07-07 10:43 UTC] mdy_x at yahoo dot com
Description:
------------
mysqli_stmt_bind_param() doesn't work as expected, when the param is a string like: 'a','b','c'
Reproduce code:
---------------
$sql='select surname from user where name in (?)';
$stmt = this->connection->prepareQuery($sql);
$stmt->bind_param('s', $nameList);
Expected result:
----------------
'Jake', 'Mary','Tom'
Actual result:
--------------
No result
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 03:00:01 2025 UTC |
hi again, here is the sample code: <?php ... $sql='SELECT surname FROM user WHERE name IN (?)'; $surNameList='Jake,Tom,Mary'; $stmt=$con->prepareQuery($sql); $stmt->bind_param('s',$surNameList); ... ?> I expect the surnames of these people as a result set, but it returns nothing... By the way, it is a very very basic need, PHP doesn't have to be magician to do this work - at least, I hope so :)