Jump to content

[SOLVED] Supplied argument is not a valid MySQL resource


moon 111

Recommended Posts

For some reason the following generates this error:

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ... on line 18

 

<?php
$q = "SELECT * FROM category";

$r = mysql_query($q); // Line 18
?>

 

and I connect to the database earlier on:

 

<?php
$server = '**';
$dbuser = '**';
$dbpass = '**';
$db = '**';

mysql_connect($server, $dbuser, $dbpass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
?>

 

What is the problem?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.