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!
Edited by schnautzr, 12 December 2010 - 12:24 PM.
resolved


Sign In
Create Account

Back to top









