Jump to content


Check out our Community Blogs

schnautzr

Member Since 12 Dec 2010
Offline Last Active Dec 12 2010 12:34 PM
-----

Topics I've Started

RESOLVED: mysql_fetch_array() expects parameter 1 to be resource, object given

12 December 2010 - 12:04 PM

Hi,

I spent several hours looking for an answer to this and have read dozens of threads, but they all seem to be case-specific-- none of the solutions I've found so far have helped me.

For the sake of simplicity, I'll omit variable declarations and such and just show you the actual string values. It'll be easier on the eyes and more compact, plus it puts it into context.

<?php
$DBConnect = @mysqli_connect("localhost", "root", "");
mysqli_select_db($DBConnect, "survey");
$QueryResult = @mysqli_query($DBConnect,
"SELECT password FROM clients WHERE username = \"schnautzr\"");

echo mysql_fetch_array($QueryResult);
//Warning: mysql_fetch_array() expects parameter 1 to be resource, object given
?>


All I'm trying to do is display the single value in the column "password" as a string-- if I can at least manipulate it as a string value then I should be able to compare it to another string. The database connection is good, the query functions perfectly (I tested it in the command prompt and in the PHP), but the echo statement simply won't work.

I assume someone around here can spot the flaw. Thanks in advance!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download