3

如何向其中添加 SQL 通配符:

 sprintf("SELECT robot FROM robots WHERE robot LIKE '%s'",strtolower($user_agent));

作为

 sprintf("SELECT robot FROM robots WHERE robot LIKE '%%s%'",strtolower($user_agent));

爆炸成壮观的火球,

PS对不起这个相当基本的问题。这些天我正在减少我的咖啡。

4

1 回答 1

15

文字%被指定为%%,所以你想要"... LIKE '%%%s%%'"

于 2008-12-16T11:20:55.617 回答