Jump to content

what does this error mean?


pietbez

Recommended Posts

is this a problem with my script or my mysql?

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/clipkcom/public_html/includes/classes/mysql_queries.class.php on line 29

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/clipkcom/public_html/includes/classes/mysql_queries.class.php on line 38

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/clipkcom/public_html/includes/classes/mysql_queries.class.php on line 56

Link to comment
Share on other sites

these are the lines that the error refers to

 

function Get_Website_Details(){
$query = mysql_query("SELECT * FROM config");
while($row = mysql_fetch_array($query)){
$name = $row['name'];
$data[$name] = $row['value'];
}
return $data;
}

function Get_Email_Settings(){
$query = mysql_query("SELECT * FROM email_settings");
while($row = mysql_fetch_array($query)){
$name = $row['email_settings_name'];
$data[$name] = $row['email_settings_value'];
}
return $data;
}

Link to comment
Share on other sites

could i get this error if my server is running php4 instead of php5?

 

i dont understand it. my host says the server is configured for this software. and the software is exactly as downloaded from the site eccept for gonfig.php changed to my server details.

 

the software veddor offers a paid installation, but i will feel robbed if it is something i should be able to do myself?

 

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/clipkcom/public_html/includes/classes/mysql_queries.class.php on line 29

 

Warning: main() [function.main]: open_basedir restriction in effect. File(/includes/templatelib/Template.class.php) is not within the allowed path(s): (/home/clipkcom/:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp) in /home/clipkcom/public_html/includes/admin_config.php on line 103

 

Warning: main(/includes/templatelib/Template.class.php) [function.main]: failed to open stream: Operation not permitted in /home/clipkcom/public_html/includes/admin_config.php on line 103

 

Fatal error: main() [function.require]: Failed opening required '/includes/templatelib/Template.class.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/clipkcom/public_html/includes/admin_config.php on line 103

Link to comment
Share on other sites

The error about "mysql_fetch_array(): supplied argument is not a valid MySQL result resource" means that the mysql_query() failed but the code blindly attempted to fetch a row form a non-existent result resource.

 

If there is no valid connection to a mysql server (link resources are global and are available everywhere in a script), there would have been a warning message generated by the mysql_query() function call when it attempted to create a link using default connection settings.

 

This leaves either no database has been selected or the query contains an error, such as a missing table or column name.

 

Get php/mysql to tell you why the query failed. I think micmania1's post intended to show this, but it is missing a reference to the mysql_query() statement. The most direct code would be to change the mysql_query() statement to the following -

 

$query = mysql_query("SELECT * FROM config") or die("Query failed: ." mysql_error()); // assuming this is the mysql_query immediately before where the existing error message is being generated.

 

-------

 

if the open_basedir errors don't normally occur on this server, then it is likely that the path being specified is incorrect. There is a leading slash / shown in the error message. This refers to the root of the current disk. Re-check your settings to make sure you have entered the path correctly.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.