mysqli prepared statement with multiple argument in one para

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adrivetest
Forum Newbie
Posts: 3
Joined: Thu Apr 10, 2008 4:12 am

mysqli prepared statement with multiple argument in one para

Post by adrivetest »

i'm in a situation where i might need to do such query :

select * from table where field1 IN (val1, val2, val3).

From the examples i've seen over the net, they're all showing
how to bind each '?' with a value only.

select * from table where field1 IN (?, ?, ?).

bind_param("iii", par1, par2, par3)


But what happens now is that I might not know the exact number of values that I'll need to put in field1, how should I do this?


Is it :

select * from table where field1 IN (?).


somewhere, a par1 is prepared :

$par1 has "101, 102, 103,104,105"

bind_param("i", $par1) ?
Post Reply