MySql Right Join to hook.
Posted: 2018-05-17 22:13
Trying to to input data from tbl1 to empty tbl2. My php comes from successful query in phpmyadmin, now would like to add as hook so on page load, data is retrieved from tbl1 and sent to tbl2.
I tried this code, it run with blank screen, not sure how to proceed
In; ../hooks/FF_Reference_Check.php
I tried this code, it run with blank screen, not sure how to proceed
In; ../hooks/FF_Reference_Check.php
Code: Select all
function FF_Reference_Check_init(&$options, $memberInfo, &$args){
$sql = "SELECT ID, FamilyFile, LastName, FirstName, Birth, BirthDate, BirthPlace, Father, Mother, SpouseName\n"
. "FROM FF_Reference_Check\n"
. "RIGHT JOIN MacLellanGenealogy USING (ID, FamilyFile, LastName, FirstName, Birth, BirthDate, BirthPlace, Father, Mother)\n"
. "WHERE FamilyFile IS NOT NULL\n"
. "\n"
. "ORDER BY case when `FamilyFile` is null then 1 else 0 end, `FamilyFile`";
}
return $query;
}