以下代码在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'];
}