I am analyzing a code and I receive the next error
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\AktiveKB\admin\includes\classes\class.auth.php on line 175
I am new in php and I don't know how to handle this error

Hello,

When posting an error code, you should always include the code.

Sorry guys. I've just being tired

function SetupHomePageLinks()
		{
			$arrPermissions = $GLOBALS["AKB_CLASS_AUTH"]->GetPermissions();

			// Get the number of user submitted questions
			$GLOBALS["NumSubmittedQuestions"] = mysql_result(mysql_query(sprintf("select count(pk_squestId) from %ssubmittedquestions", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of pending comments
			$GLOBALS["NumPendingComments"] = mysql_result(mysql_query(sprintf("select count(pk_commentId) from %scomments where cStatus='pending'", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of questions
			$GLOBALS["NumQuestions"] = mysql_result(mysql_query(sprintf("select count(pk_questId) from %squestions", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of visible questions
			$GLOBALS["NumVisibleQuestions"] = mysql_result(mysql_query(sprintf("select count(pk_questId) from %squestions where qVisible=1", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of visible questions
			$GLOBALS["NumHiddenQuestions"] = mysql_result(mysql_query(sprintf("select count(pk_questId) from %squestions where qVisible=0", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of comments
			$GLOBALS["NumComments"] = mysql_result(mysql_query(sprintf("select count(pk_commentId) from %scomments", $GLOBALS["tablePrefix"])), 0, 0);

			// Get the number of pending comments
			$GLOBALS["NumPendingComments"] = mysql_result(mysql_query(sprintf("select count(pk_commentId) from %scomments where cStatus='pending'", $GLOBALS["tablePrefix"])), 0, 0);
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.