<br>Thanks to everyone that replied.<br><br><br>To summarise then:<br><br> 1) I need to make a custom module.<br> 2) The module should have a block for displaying the query and a menu hook<br> 3) I can add the module to either primary links or navigation as a menu item<br>
4) Rendered HTML using mysql commands is quite straight forward<br> 5) The tables being queried are easier to access within the main drupal d/b but i can use a different db<br> <br><br>Regarding a different db, does this command:<br>
<br>db_set_active('customerdb');<br><br>make *all* db queries go through customerdb or just the ones for my module? <br>ie will drupal have any issues accessing the data it needs from say "drupaldb" if I dont change <br>
the active db back again?<br><br><br><br><br><br><div class="gmail_quote">On Tue, Nov 17, 2009 at 9:27 AM, Earl Dunovant <span dir="ltr"><<a href="mailto:prometheus6@gmail.com">prometheus6@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im"><div class="gmail_quote">On Mon, Nov 16, 2009 at 7:55 AM, spartaguy spartaguy <span dir="ltr"><<a href="mailto:spartaguy300@gmail.com" target="_blank">spartaguy300@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br> 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.<br><br>I want to do a select * on customer_data in the customer database and show the result on screen.<br>
<br>Can someone tell me how to do this?<div><div></div><div><br></div></div></blockquote></div><br></div>Your bare bones menu item is something like this:<br><br><code><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 187);"> $items</span><span style="color: rgb(0, 119, 0);">[</span><span style="color: rgb(221, 0, 0);">'mypath/%object'</span><span style="color: rgb(0, 119, 0);">] = array(<br>
</span><span style="color: rgb(221, 0, 0);">'title' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'Page title'</span><span style="color: rgb(0, 119, 0);">,<br>
</span><span style="color: rgb(0, 119, 0);"> </span><span style="color: rgb(221, 0, 0);">'description' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'Your description goes here.'</span><span style="color: rgb(0, 119, 0);">,<br>
</span><span style="color: rgb(0, 119, 0);"> </span><span style="color: rgb(221, 0, 0);">'access arguments' </span><span style="color: rgb(0, 119, 0);">=> array(</span><span style="color: rgb(0, 0, 187);">'permission string')</span><span style="color: rgb(0, 119, 0);">,<br>
</span><span style="color: rgb(0, 119, 0);"> </span><span style="color: rgb(221, 0, 0);">'page callback' </span><span style="color: rgb(0, 119, 0);">=> </span><span style="color: rgb(221, 0, 0);">'customer_display'</span><span style="color: rgb(0, 119, 0);">,<br>
</span><span style="color: rgb(0, 119, 0);"> );</span></span></code><br><br>Then write a function named customer_display() that runs queries the way Frederik showed you and returns a string containing rendered HTML.<br>
</blockquote></div><br>