Join across two databases
Join across two databases
Twiggy21
Posts: 16Questions: 6Answers: 0
Hi There,
I read the two threads about this topic... I am using two databases in the same MySQL server and I believe I am using qualified database names but I still get a blank screen which seems to be a PHP error but it displays no error message so it is hard to troubleshoot.
Here is my code:
$(document).ready(function() {
editor = new $.fn.dataTable.Editor( {
ajax: "../editor/php/test_processing.php",
table: "#pp",
fields: [
{
label: "First Name",
name: "crm.primary_profile.fName",
type: "readonly",
},
{
label: "Last Name",
name: "ia_application.kpp_comments.app_lName",
type: "text",
}
]
} );
// Activate an inline edit on click of a table cell
$('#pp').on( 'click', 'tbody td:not(:first-child)', function (e) {
editor.inline( this, {
onBlur: 'submit',
buttons: { label: '>', fn: function () { this.submit(); } }
} );
} );
$('#pp').DataTable( {
//sDom: "Bfrtipl",
"sDom": '<"top"<"actions">Bfl<"clear">><"clear">rtpi<"bottom">',
ajax: {
url: "../editor/php/test_processing.php",
type: 'POST'
},
columns: [
{
data: null,
defaultContent: '',
className: 'select-checkbox',
orderable: false
},
{ data: "crm.primary_profile.fName"},
{ data: "ia_application.kpp_comments.app_lName"}
],
order: [ 1, 'asc' ],
select: {
style: 'os',
selector: 'td:first-child'
},
} );
} );
</script>
<?php
// DataTables PHP library
include( "DataTables.php");
// Alias Editor classes so they are easy to use
use
DataTables\Editor,
DataTables\Editor\Field,
DataTables\Editor\Format,
DataTables\Editor\Mjoin,
DataTables\Editor\Upload,
DataTables\Editor\Validate;
Editor::inst( $db, 'crm.primary_profile', 'puid')
->field(
Field::inst( 'crm.primary_profile.fName' ),
Field::inst( 'ia_application.kpp_comments.app_lName' )
)
->leftJoin( 'ia_application.kpp_comments', 'ia_application.kpp_comments.puid', '=', 'crm.primary_profile.puid' )
->process($_POST)
->json();
I know I am making some newbie mistake but I can not figure it out with out any errors to go on. Any help would be a god send!
This discussion has been closed.