[support] Search an external MSQL table?

Larry Garfield larry at garfieldtech.com
Sat Jan 27 16:05:40 UTC 2007


It sounds like you want a node type called "library_item".  That gives you add 
and edit forms.  Drupal's built-in search functionality can let you search 
those as well as other nodes, or restrict the search to just one node type.  
To create a form that searches just one node type, do an advanced search with 
the search module (built-in) on just one node type and see what the URL looks 
like.  Then write a new form (using Drupal's Form API!) that simply adds on 
whatever the "one node only" parameters are and submits to the common search 
page.

For creating nodes, you can either model node_example.module 
(http://api.drupal.org/) or use CCK (http://drupal.org/project/cck) to define 
the node type dynamically through Drupal.  I personally prefer the latter as 
it's much faster and more flexible, but YMMV.  

On Saturday 27 January 2007 9:22 am, John Clarke wrote:
> Hi, I am working with a functioning Drupal site and have been asked to add
> an additional MYSQL table (book/resource library items) and a SIMPLE entry,
> edit and search form. I want the users to be able to search on several
> fields at once always with a %like% argument. Also, I need some simple
> results control (i.e. max items per page).
>
> Are there any Drupal-friendly PHP snippets that I could use to do this? My
> MYSQL table is up and running so I only need the scripts.
>
> Any suggestions are welcome.
>
> -John

-- 
Larry Garfield			AIM: LOLG42
larry at garfieldtech.com		ICQ: 6817012

"If nature has made any one thing less susceptible than all others of 
exclusive property, it is the action of the thinking power called an idea, 
which an individual may exclusively possess as long as he keeps it to 
himself; but the moment it is divulged, it forces itself into the possession 
of every one, and the receiver cannot dispossess himself of it."  -- Thomas 
Jefferson


More information about the support mailing list