This topic is locked
[SOLVED]

 Multiple database connections

4/20/2015 4:45:01 AM
PHPRunner General questions
C
cms001 author

Hi,
I am using build 23504 x64
I have 2 database connections:

ConA - this database manage the user audits, groups, members and rights

ConB - manage the daily transactions
My primary connection is ConA and ConB the secondary connection
Everything is working fine - but now I have added code to a transaction table wshop_t, "Before Record added" event - to check if a specific record exist.
When Submit I then get this error, Error descriptionTable 'cms.wshop_t' doesn't exist
So it is looking for the table in the wrong place because this table exists in the secondary database, ConB and it is looking for the table in ConA connection.
How do I fix this ?

C
cms001 author 4/20/2015


[color=#1F497D]I changed the following in the sql statement, before_record_added event.
[color=#1F497D]
[color=#1F497D]$strSQLExists = "select * from TABLENAME where VEHNO_ZW = '" . $values['VEHNO_ZW'] . "' and STAT_ZW = '" .$values['STAT_ZW'] . "'" ;
[color=#1F497D](ABOVE, I SPECIFIED THE TABLENAME ONLY)
[color=#1F497D]No Error:
[color=#1F497D]
[color=#1F497D]
My question - Is this the way we need to specify sql statements with multiple connections - or is this an error in phpRunner ?

Sergey Kornilov admin 4/20/2015

This is how databases work - you need to specify fully specified table name accessing table in another database or schema.