Basically, what I'm trying to do (and I may be heading down the wrong path here..) is creating a page in drupal with a search form that people can use to query a separate mysql database and display the results of the query. It doesn't seem like an unusual task, but I haven't yet found any documentation that's laid out how to do this yet.
Is there a module, or a tutorial or documentation that anyone knows of that would give me more info on this topic?
I read http://drupal.org/node/18429 which tells how to connect to a different mysql database, and how to switch back to the drupal db. I'm still trying to figure out if I can create a form in a "Page" and show the results in the same page or not.
Any thoughts? Sign posts? Constructive ridicule?
Thanks for your time!
Comments
I'm a little bit further
I'm a little bit further. I found this tutorial: http://drupal.org/node/262422 that shows how to create a custom module that creates a form. Now I just need to run a query with input from the form and figure out how to display the results.
I have been trying to do the same... need further help please
Hi mate, I was wondering if you have any live example of the finished search form that I can take a look at ? I've been searching for answers on how to do this as well for a few months. Thanks in advance !
Phew! I got it working.
Phew! I got it working. Just in case anyone else is working on something similar, here's what I did:
1. Followed the instructions here http://drupal.org/node/18429 to add another db connection.
2. Followed the instructions here http://drupal.org/node/262422 to create a custom form module.
3. Floundered around in the drupal api documentation until I came up with these (simplified) functions:
I don't see anything wrong
I don't see anything wrong with that, you could always make a theme function available in your module if you're really fussy :)
Thank you!
mauszozo,
Thank you very, very, very much.
Rodney
Actually, you are using
Actually, you are using tables exactly the way they are intended to be used - to display tabular data - you know, something from a spreadsheet or database table. As opposed to using them for layout.
BTW, thanks for this.
Again thank you this works great. Two questions though.
Greetings,
Again thank you for sharing this. I have tried doing this many different ways and failed. I do have two questions though. 1)Is there a way to list the title of the rows? 2)Also is there a way to diplay these sorted?
example 1
Top five strongest players going by experience
Player XP
tony 100
jill 83
mike 12
ripe 7
lost 2
Example 2
Top five wealthiest players going by money
Player money
alice 123
ann 84
mike 33
dee 12
sam 5
I tried a few ways I know using mysql, php, table data and I just can't get it to title the rows or sort with out goofing up the work you showed us how to do.
Need something similar, good
Need something similar, good poit to start, thanx
complete code
Can you show all your code and show where the code is located?