当我复制查询它在phpmyadmin工作但在PHP中它不起作用

时间:2016-07-22 22:56:00

标签: php mysql mysqli phpmyadmin

以下代码在php中不起作用,但是当我复制查询时,它在phpmyadmin中工作。 连接到数据库是好的,没有错误。

 $con=mysqli_connect($config['host'],$config['user'],$config['password'],$config['database']);

$selecturl=mysqli_query($con,"SELECT url,cpc FROM urls WHERE url NOT IN (SELECT url FROM VIEW WHERE `username` = $username) ORDER BY cpc DESC LIMIT 0 , 1");
while($query=mysqli_fetch_assoc($selecturl))
{
    $urltoshow=$query['url'];
}

0 个答案:

没有答案