开发者

multiple params in a mysql statement

i use this statement for a single where condition ('SELECT * FROM users WHERE id = ?', 1)

if I want to check开发者_高级运维 two conditions, how would I do that

('SELECT * FROM users WHERE id=? AND age=?', 1,23)- is this correct?


It depends on the client library and/or framework you're using. In most cases, what you've got there is fine. In others, you have to pass an array, and in others still, you can pass an associative array (or dictionary) and use named values in your query.

If you want a more detailed answer, you need to provide more details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜