pietbez Posted July 18, 2008 Share Posted July 18, 2008 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 Quote Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 18, 2008 Share Posted July 18, 2008 It means the handle you're using for mysql_fetch_array is wrong. Problem with the script. Quote Link to comment Share on other sites More sharing options...
pietbez Posted July 18, 2008 Author Share Posted July 18, 2008 this is odd?? it is a opensource script. clip-bucket. i havnt changed anything and i have installed it before with no problem. mmmm, il dig a bit deeper. thanks for the fast reply Quote Link to comment Share on other sites More sharing options...
JasonLewis Posted July 18, 2008 Share Posted July 18, 2008 Check the lines it mentioned. Then check the queries that are being passed to it. Quote Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 18, 2008 Share Posted July 18, 2008 Check to make sure your connection to the database worked OK.... $mysql = mysql_connect("host", "user", "pass") or die(mysql_error()); If your connection didn't work properly, you may also see this when you try to use the resource. Quote Link to comment Share on other sites More sharing options...
unkwntech Posted July 18, 2008 Share Posted July 18, 2008 And maybe post the script so we can take a look. Quote Link to comment Share on other sites More sharing options...
pietbez Posted July 18, 2008 Author Share Posted July 18, 2008 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; } Quote Link to comment Share on other sites More sharing options...
JonnyThunder Posted July 18, 2008 Share Posted July 18, 2008 Is the database connection created outside of these functions?? If so, thats your problem. Connections created outside the function cannot be seen inside the function - that would cause the error you specified. Quote Link to comment Share on other sites More sharing options...
micmania1 Posted July 18, 2008 Share Posted July 18, 2008 Check to make sure the tables exist too. $query = mysql_query("SELECT * FROM config"); if ($query) { while etc..... } else { echo $query.'<br /><br />'.exit; } That will give you more error info. Quote Link to comment Share on other sites More sharing options...
pietbez Posted July 18, 2008 Author Share Posted July 18, 2008 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 Quote Link to comment Share on other sites More sharing options...
awpti Posted July 18, 2008 Share Posted July 18, 2008 Your host needs to disable the open_basedir restriction. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted July 18, 2008 Share Posted July 18, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.