开发者

variable in MYSQL requery with REGEXP

HI, I am trying the below code .

 $do开发者_高级运维main = $_GET['url'];
 $sql = 'SELECT * FROM `domains` WHERE `domain` REGEXP CONVERT(_utf8 \'$url\' USING latin1) COLLATE latin1_swedish_ci';
 $result = mysql_query($sql);

 while($row = mysql_fetch_array($result, MYSQL_NUM))
{
    echo "id :{$row[0]} <br>";

}

will get the domain from user using $_GET and then regex that from database .. This query is not working , please tell me the proper syntax I even tried double quotes \"$domain"\


$sql = "SELECT * FROM `domains` WHERE `domain` REGEXP CONVERT(_utf8 '".$url."' USING latin1) COLLATE latin1_swedish_ci";
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜