Hi there, im trying to use the function "Save to different database" (chronoforms v4.0 rc3.3) because i want to save the data from the forms in another database, not the joomla one, but, when i fill the advanced tab with the database parameters (dbhost, dbuser, userpass, etc) and click "refresh table list" i allways receive the message "DB connection failed". I've read other posts in wich u (support team generally Greyhead) recommends to double check the database parameters and to check if mysql remote connections are allowed, well, ive re-rechecked those parameters but im still not able to connect the other DB, im not sure if mysql is allowing remote connections because im using Appserv software (it includes apache, php and mysql) i already reviewed the configuration files of appserv mysql's server but couldnt find the option to allow remote connection, however im working in a local enviroment, so i suppose remote connection option should not be needed, could u bring me a little of help please!!!
Hi alexis reyes,
I'm sorry I don't have anything much to suggest apart from the settings that you've already checked. If the second database is on the same localhost installation then connection should be possible.
Bob
I'm sorry I don't have anything much to suggest apart from the settings that you've already checked. If the second database is on the same localhost installation then connection should be possible.
Bob
Hi greyhead, (by the way, nice to meet you after read lots of post from u in my way to learn how to use chronoforms) well, im not able to connect the another database yet using DB Save option, however, i found i could use the Custom Code option in wich i can input php code to make the connection to the other DB, i tried it and works fine, now i can save my records in a different DB not just in the joomla one, i've now to search the way to use some code just once, by example the php database connection lines " $link=mysql_connect("localhost", "user", "pass");
mysql_select_db("database",$link); " for not being input this code every submit form i make, so if u could help me with this ill appreciate it. Thanks for ur reply. Have a nice day.
(by the way, sorry if my english is bad, i speak spanish)
mysql_select_db("database",$link); " for not being input this code every submit form i make, so if u could help me with this ill appreciate it. Thanks for ur reply. Have a nice day.
(by the way, sorry if my english is bad, i speak spanish)
Hi alexis,
The DB Record Loader uses this code behind the scenes (or very similar Joomla! code) so I'm not sure why this would work when the DB Record Loader doesn't. Here's the code used:
Bob
The DB Record Loader uses this code behind the scenes (or very similar Joomla! code) so I'm not sure why this would work when the DB Record Loader doesn't. Here's the code used:
$option = array();
$option['driver'] = $params->get('ndb_driver', 'mysql');// Database driver name
$option['host'] = $params->get('ndb_host', 'localhost');// Database host name
$option['user'] = $params->get('ndb_user', '');// User for database authentication
$option['password'] = $params->get('ndb_password', '');// Password for database authentication
$option['database'] = $params->get('ndb_database', '');// Database name
$option['prefix'] = $params->get('ndb_prefix', 'jos_');// Database prefix (may be empty)
$database = & JDatabase::getInstance($option);
Bob
Hi
I had the same problem.
I tested the connection parameters using a test php file:
<?php
mysql_connect("localhost", "xxxxx", "XXXX") or die(mysql_error());
echo "Connected to MySQLt<br />";
mysql_select_db("xxxxxxx") or die(mysql_error());
echo "Connected to Database";
?>
Placing same connection info in the advanced DB SAVE fields wasn't working.
I upgraded from Chronoforms V4 RC 3.4 to V4_RC3.5 with no success also.
So I digged in, and found the 'DB Connection Failed' message in the db_save.php file in /administrator/components/com_chronoforms/form_actions/db_save folder
I commented out the if clause between lines 143 and 152, and now it works - the database tables are listed and I'm able to select one.
What I don't know is what exactly gets evaluated in line 143:
if(get_class($database) == 'JDatabase'){
Greetings,
I had the same problem.
I tested the connection parameters using a test php file:
<?php
mysql_connect("localhost", "xxxxx", "XXXX") or die(mysql_error());
echo "Connected to MySQLt<br />";
mysql_select_db("xxxxxxx") or die(mysql_error());
echo "Connected to Database";
?>
Placing same connection info in the advanced DB SAVE fields wasn't working.
I upgraded from Chronoforms V4 RC 3.4 to V4_RC3.5 with no success also.
So I digged in, and found the 'DB Connection Failed' message in the db_save.php file in /administrator/components/com_chronoforms/form_actions/db_save folder
I commented out the if clause between lines 143 and 152, and now it works - the database tables are listed and I'm able to select one.
What I don't know is what exactly gets evaluated in line 143:
if(get_class($database) == 'JDatabase'){
Greetings,
Hi murrieta,
I don't know why it fails without more exploration; the 'if' line is trying to check that a database connection has been found.
Bob
I don't know why it fails without more exploration; the 'if' line is trying to check that a database connection has been found.
Bob
This topic is locked and no more replies can be posted.