PHP Error

Mrgames05

New Member
Messages
9
Reaction score
0
Points
0
I currently have the PHP level of 2 as my php (in my account)

I receive this error when it ry to go to my website:

Code:
[B]Warning[/B]: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [B]/home/mrgames/public_html/projectext/ext/includes/globals.php[/B] on line [B]6[/B]

Here is the source code of my globals.php:

PHP:
<?php
//in debug mode or not?
$query = 'SELECT * FROM ext_general';
$command = mysql_query ($query);
$result = mysql_fetch_array ($command);
 or die ($db_error);
$debug = $result['debug'];
if ($debug == 1)
{
 $debug = true;
}
else
{
 $debug = false; 
}
//Message shown in register.php
$register_message = "Welcome to Project Extension. Project Extension is currently still under development of iQuest Studios";
//DB Error message
$db_error = mysql_error();
?>

Any suggestions?


(ps... wasn't sure if this was the right section. If not, sorry)
 
Last edited:

panop

New Member
Messages
64
Reaction score
0
Points
0
What the error message is telling you is that "mysql_fetch_array" is not a valid function. The rest of the code says that if the code fails, that error message is displayed.
 

Livewire

Abuse Compliance Officer
Staff member
Messages
18,169
Reaction score
216
Points
63
What the error message is telling you is that "mysql_fetch_array" is not a valid function. The rest of the code says that if the code fails, that error message is displayed.

Actually you're highly mistaken.

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource

What that error message is saying is the argument passed to mysql_fetch_array is NOT a valid result set returned by mysql_query(<yourqueryhere>).

If the function didn't exist, you'd get something like Error: Call to undefined function mysql_fetch_array() in <path> <filename> line <#>.

That is caused by the query being poorly formatted. Now since the query is so small, it leads to two possibilities:

1) Did you log in and select the proper database with the appropriate mysql commands, cause I don't see anything like that there if you did.

2) Is there even a table named ext_general?


Also brings about a third question:

Why is this in Pre-Signup questions if you've already got an account?
 
Last edited:

Russ

<b>Retired *****</b>
Messages
3,168
Reaction score
2
Points
38
In the future, this is not the appropriate forum for this type of post. Please be sure to post in the right place next time.
 
Top