PHP Prepared Statements ...在REGEX中将变量绑定为数值范围?

时间:2012-09-23 01:00:03

标签: php mysql regex pdo

$query = "SELECT * FROM `mytable` WHERE `file` REGEXP '[:val-9]'";
$stmt = $dbh->prepare($query);
$stmt->bindValue(':val', '1'); //I have also tried 1 without quotes
$stmt->execute();

引发此错误:

  

语法错误或访问冲突:1139收到错误'无效字符   范围'来自正则表达式

是否可以这样做..

0 个答案:

没有答案