I selected a database, but for some strange reason, it still says that it is not selected.
Connection lines:
$location = "localhost";
$user = "user";
$pass = "pass";
$link = mysql_connect($location, $user, $pass);
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db('database') or die(mysql_error());
Inquiry:
while ($row_fpages = mysql_fetch_array($result_fanpage))
{
if ( $row_fpages['client'] == NULL ) {
$sql = "SELECT date, likes FROM statistics_pages WHERE idnum='".$_COOKIE['id']."' AND page_name = ".$row_fpages['page_name']." LIMIT 7";
$result_apps = mysql_query($sql) or die(mysql_error());
And the error is simple No database selected.
I have never seen this error before, and I tried to change a lot of things, but just didn't work.
source
share