Forums

Multi Record Loader - Data from external database

momentis 26 Mar, 2012
I am trying to create a form that will pull records from a different database (located on same server). I need to use the DB Multi Record Loader (I think), but I cannot see a way to configure it for an external database. Is there a way to do this?
GreyHead 26 Mar, 2012
Hi Rick,

On the Advanced tab I think.

Bob
momentis 26 Mar, 2012
Hey Bob!

I had checked there, but there is no option. The DB Save action has this on the advanced tab, but not DB Record or DB Multi Record loaders.
GreyHead 26 Mar, 2012
Hi Rick,

Sorry, I never noticed that wasn't there :-(

Then I guess it's back to hand-coding . . . the code for CFv3 is in this document I think it should still work for CFv4.

Bob
momentis 26 Mar, 2012
Thanks!!

Perhaps Max could get this in a future release? That would really be awesome!
momentis 04 Apr, 2012
Bob,

I am thoroughly LOST on this. I have the following in a Custom Code action on a form:

<?php
$option = array();
$option['driver']   = 'mysql';
$option['host']     = 'localhost';
$option['user']     = 'REDACTED';
$option['password'] = 'REDACTED';
$option['database'] = 'REDACTED';
$option['prefix']   = '25teac_';

$db2 = & JDatabase::getInstance( $option );
$query = "SELECT name FROM #__users WHERE id = 43";
$db2->setQuery($query);
$result = $db2->loadResult();
echo $result;
?>


which does absolutely nothing. I need to be able to query and display information from another database on the same server (same hosting account) in a CF form. Can you please help?

Thanks!!!
momentis 04 Apr, 2012
Bob,

I gave up on this, but came up with a better (and much simpler) solution. The two different databases were both for the same client. One was for the main site and one for a classroom site. I just merged the classroom tables into the same database as the main site, but with their different prefix. One configuration change to the classroom site and presto - ALL tables are now easily accessible from CF in either site.

It would still be VERY helpful if Max could integrate the connection settings right into the DB Multi Record Loader, especially for idiots like me!!
GreyHead 05 Apr, 2012
Hi Rick,

I've added this to the bugs list as a request.

Bob
This topic is locked and no more replies can be posted.