First lets start w/ the error:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in ******/process.php on line 29
Code: Select all
//lines 27 to 33 -> error line is $row = mysql_fetch_array($result);
$result = $database->selectData(TABLE_BARS,"id","username='".$username."' && password='".md5($password)."' LIMIT 1");
if($result){
$row = mysql_fetch_array($result);
$id = $row['id'];
$this->addError("In if");
$type = "bar";
}
Code: Select all
function selectData($table, $toSelect, $whereStm){
$q = "SELECT ".$toSelect." FROM ".$table." WHERE ".$whereStm;
return mysql_query($q) or die("ERROR: ".mysql_error());
}
SELECT id FROM bars WHERE username='tester' && password='a029d0df84eb5549c641e04a9ef389e5' LIMIT 1
which when put into mysql prompt returns 1 row. So mysql_query should work, return a value, and I should be able to take the mysql_fetch_array of it. Any ideas why this would not be working?