Call to undefined function db_query()
Ajay on January 31st, 2008
Drupal provides the function db_query() to interact with database.
This function is defined in includes/database.inc file.
You have to include database.inc in your file to get db_query() working.
<?php include(”includes/database.inc”); ?>
However if you are trying to access drupal database from a non-drupal .php file then all you need to do is to include following lines at the top of your file.
require_once ‘./includes/bootstrap.inc’;
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);





































Leave a Reply
You must be logged in to post a comment.