By agerson on
I am writing am module that gets some data from an external database. I have been able to query the external database with the information from
is there a way to get a module to add an external database reference without modifying settings.php by hand?
Comments
Modify the $db_url global
You should be able to modify the global $db_url variable yourself - something along the lines of the (untested, untried!) code below.
As always, with modifying globals, you might break modules that maintain internal caches based on them.
Thanks BladeRider,
Thanks BladeRider,
I tested this and it does work. The only correction is:
should be
Is there any community consensus on this technique vs just using the built in php mysql_connect, mysql_query, etc... functions inside a custom module wanting external sql data? One drawback to using the php mysql functions is security concerns.
Is there a more secure way to use the built in functions:
Hi, I too needed the same
Hi,
I too needed the same help. i want to query an external database using drupal. Since I am very new to Drupal , just don't know how to get started. I tried reading on the book Pro-Drupal Dev, but doesn't seem to help me much. Can you tel me how should I go forward or give me tips in hardcoding?