[support] Database connection
Metzler, David
metzlerd at evergreen.edu
Mon Mar 26 15:03:08 UTC 2012
Any reason why you don't just create a custom module with a menu hook
that executes a print of the data that you need? This is the way I code
most of my web service code.
Something like;
function custom_module_menu() {
$items['custom_module'] = array(
'access arguments' => 'access content' // replace this with
appropriate drupal security.
'page callback' => 'custom_module_ajax_callback',
'type' => MENU_CALLBACK,
);
return $items;
}
function custom_module_ajax_callback() {
//execute normal drupal statements here
print 'replace this with whatever you want the ajax callback to
return';
}
You'd also need a .info file, but that would get you started.
________________________________
From: support-bounces at drupal.org [mailto:support-bounces at drupal.org] On
Behalf Of Gerald Klein
Sent: Saturday, March 24, 2012 8:18 PM
To: support at drupal.org
Subject: Re: [support] Database connection
I tried this and also included the define statement for the variable
that require_once is using and it errors out including bootstrap.inc.
It needs something else.
thanks for your post, anyone else?
define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
On Sat, Mar 24, 2012 at 10:12 PM, Vaibhav Jain
<in.vaibhavjain at gmail.com> wrote:
Just paste these 2 lines in you external file
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
these are also included in index.php. These are for D6
On Sun, Mar 25, 2012 at 8:28 AM, Gerald Klein <jk at zognet.com> wrote:
Hi I need to pull a dataset in an ajax file. What drupal includes to I
need to use the drupal db connection.
thanks any help is appreciated
--jerry
--
Gerald Klein DBA
www.geraldklein.com <http://geraldklein.com/>
jk at zognet.com <mailto:jk at zognet.com>
708-599-0352
Linux registered user #548580
--
[ Drupal support list | http://lists.drupal.org/ ]
--
Regards,
Vaibhav Jain
--
[ Drupal support list | http://lists.drupal.org/ ]
--
Gerald Klein DBA
www.geraldklein.com <http://geraldklein.com/>
jk at zognet.com <mailto:jk at zognet.com>
708-599-0352
Linux registered user #548580
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20120326/e4df199d/attachment.html
More information about the support
mailing list