[development] new dev q: are mysql queries possible within drupal?

Earl Dunovant prometheus6 at gmail.com
Tue Nov 17 00:27:19 UTC 2009


On Mon, Nov 16, 2009 at 7:55 AM, spartaguy spartaguy <spartaguy300 at gmail.com
> wrote:

>
>  I have two databases - one is for drupal data. The other db is for
> customer data. Inside the customer data db is a table - customer_data.
>
> I want to do a select * on customer_data in the customer database and show
> the result on screen.
>
> Can someone tell me how to do this?
>
>
Your bare bones menu item is something like this:

  $items['mypath/%object'] = array(
    'title' => 'Page title',
    'description' => 'Your description goes here.',
    'access arguments' => array('permission string'),
    'page callback' => 'customer_display',
  );

Then write a function named customer_display() that runs queries the way
Frederik showed you and returns a string containing rendered HTML.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20091116/22f67f81/attachment.html 


More information about the development mailing list