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

fxarte - January 19, 2009 - 20:27
Project:Http Headers
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Hi
After on the content type section I get this Drupal warning

warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /srv/www/upgrades/drupal5.modules/all/modules/httpHeaders/http_headers.module on line 106.

I'm using Drupal 5.14, on a LAMP server with PHP 5.2.5, and MySQL database 5.0.26,
Thank you

#1

matslats - January 20, 2009 - 00:33

Can you tell me is this for a content-type you have configured?

#2

fxarte - January 21, 2009 - 16:33

Yes!
but, is there any other possible configuration?
thank you

#3

not_Dries_Buytaert - October 14, 2009 - 02:52
Title:Error with mysql_fetch_array supplied argument» warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Version:5.x-1.0» 6.x-1.x-dev

The following error also occurs when using httpHeaders-6.x-1.x-dev and with any content type:
warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in {root}/sites/all/modules/httpHeaders/http_headers.module on line 113.
Apparently, the db_query string in line 113 contains the bug. That line is the third one:

//Gets the header properties of the contentType from the node_type table and returns the two values in an array
function http_headers_getType($type){
  $result = db_query("SELECT header_expires, header_lastmod FROM {node_type} WHERE type = '%s'", $type);
  return mysql_fetch_array($result);
}

NB: In the 'node_type' table:
1) the 'header_lastmod' column remains empty (???) for all unchanged content types and
2) the 'header_expires' is '0' for all content types (as long as this value remains unaltered by the user).

 
 

Drupal is a registered trademark of Dries Buytaert.