Hi,

Entering website first time. Script says Admin then admin.

Like so

Admin Id: Admin
Password: admin

But get Error. Wrong Admin Login.

Plus these errors top of page:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/adven735/public_html/config.php on line 4

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in /home/adven735/public_html/config.php on line 4

Webhost help comment:

If error message 'mysql_fetch_array(): supplied argument is not a valid MySQL result
resource' or similar is displayed on your website, it means there are some issues with
your MySQL query.

Please kindly note this error is not related to hosting service, and it's related to your
script only, so we could not provide any support in this case.

Any ideas?

Thanks,
L-D

Dani AI

Generated

The PHP warnings mean mysql_fetch_array() is getting a boolean (false) instead of a valid result resource — in short, the preceding query failed. Given ’s note that the installer shows the default admin credentials but the login still fails, the SELECT that loads the admin row probably returned false (common causes: wrong DB credentials, database not selected or imported, incorrect table name/case, SQL syntax error, or insufficient privileges). As pointed out, the fetch call needs a valid result; the real fix is to find why the query returned false.

Quick troubleshooting checklist:

  • Open config.php (the error mentions line 4) and split any nested calls so the query result is captured in a variable before fetching.
  • Verify DB host, username, password, and database name; confirm tables were created/imported and that the admin row exists (run the SELECT directly in phpMyAdmin or the mysql client).
  • Check table name case (Linux hosts are case-sensitive).
  • Enable detailed error reporting temporarily or log mysqli_error()/mysql_error() for the failing query to see the real SQL error (do not leave error display enabled on production).
  • Check PHP version on the host — the old mysql_* extension was deprecated and later removed; migration to mysqli or PDO is recommended.

Example of safer, immediate error-checking with mysqli (procedural):

$link = mysqli_connect($host, $user, $pass, $db);
if (!$link) { error_log('DB connect: ' . mysqli_connect_error()); exit; }

$sql = "SELECT * FROM admin WHERE username='admin' LIMIT 1";
$res = mysqli_query($link, $sql);
if (!$res) { error_log('Query failed: ' . mysqli_error($link) . " — SQL: $sql"); exit; }

$row = mysqli_fetch_assoc($res);

After fixing the query/connection, reset the default admin password and migrate away from mysql_* calls (use prepared statements via mysqli or PDO) for compatibility and security.

looks like you missing 1 parameter syntax should be like this
(mysql_fetch_array($result)) you can also define array_type

MYSQL_ASSOC - Associative array
MYSQL_NUM - Numeric array
MYSQL_BOTH - Default. Both associative and numeric array
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.