Solution for issue 23 -- New Phone 2 does not receive Phone 1 Finds. Added code to handle a NULL result from the query that returns MAX sync time.  If this is a new phone, it won't have a MAX sync time:
Solution for issue 23 -- New Phone 2 does not receive Phone 1 Finds.
Added code to handle a NULL result from the query that returns MAX
sync time.  If this is a new phone, it won't have a MAX sync time:

if ($time == NULL) {
     Log::getInstance()->log("getDeltaFindsIds: IF time = $time");
     $res = mysql_query("SELECT DISTINCT find_guid FROM find_history WHERE imei != '$imei'") or die(mysql_error());
} else {
     Log::getInstance()->log("getDeltaFindsIds: ELSE time = $time");
     $res = mysql_query("SELECT DISTINCT find_guid FROM find_history WHERE TIMESTAMPDIFF(SECOND,'$time',time) > 0") or die(mysql_error());
}

trishan/posit-mobile.haiti-mobile,everdefiant/posit-mobile.android,Raconeisteron/posit-mobile.haiti,Raconeisteron/posit-mobile,sanyaade-g2g-repos/posit-mobile.haiti,everdefiant/posit-mobile.haiti-mobile,google-code-export/posit-mobile,sanyaade-g2g-repos/posit-mobile.haiti-mobile,trishan/posit-mobile,sanyaade-g2g-repos/posit-mobile,google-code-export/posit-mobile,trishan/posit-mobile.web,trishan/posit-mobile.haiti,everdefiant/posit-mobile.haiti-mobile,trishan/posit-mobile.android,everdefiant/posit-mobile.haiti,Raconeisteron/posit-mobile.android,Raconeisteron/posit-mobile.haiti,prasincs/posit-mobile,everdefiant/posit-mobile.android,trishan/posit-mobile.haiti-commodity,trishan/posit-mobile.haiti-mobile,everdefiant/posit-mobile.haiti-mobile,prasincs/posit-mobile,everdefiant/posit-mobile,sanyaade-g2g-repos/posit-mobile.android,Raconeisteron/posit-mobile.web,sanyaade-g2g-repos/posit-mobile.web,everdefiant/posit-mobile,sanyaade-g2g-repos/posit-mobile,sanyaade-g2g-repos/posit-mobile.web,trishan/posit-mobile.haiti-mobile,trishan/posit-mobile.android,Raconeisteron/posit-mobile.haiti-mobile,everdefiant/posit-mobile.haiti-commodity,everdefiant/posit-mobile,sanyaade-g2g-repos/posit-mobile.android,Raconeisteron/posit-mobile.android,Raconeisteron/posit-mobile.haiti-commodity,google-code-export/posit-mobile,Raconeisteron/posit-mobile.web,everdefiant/posit-mobile.android,trishan/posit-mobile.web,trishan/posit-mobile.android,Raconeisteron/posit-mobile.haiti-commodity,Raconeisteron/posit-mobile.android,sanyaade-g2g-repos/posit-mobile.haiti-commodity,trishan/posit-mobile,google-code-export/posit-mobile,trishan/posit-mobile.android,prasincs/posit-mobile,Raconeisteron/posit-mobile,everdefiant/posit-mobile.android,trishan/posit-mobile,Raconeisteron/posit-mobile.haiti-commodity,sanyaade-g2g-repos/posit-mobile.haiti-mobile,sanyaade-g2g-repos/posit-mobile.haiti,everdefiant/posit-mobile.haiti-commodity,everdefiant/posit-mobile.web,everdefiant/posit-mobile.haiti,trishan/posit-mobile,sanyaade-g2g-repos/posit-mobile.haiti-mobile,Raconeisteron/posit-mobile,Raconeisteron/posit-mobile.android,everdefiant/posit-mobile.web,everdefiant/posit-mobile,trishan/posit-mobile.haiti,trishan/posit-mobile.haiti-mobile,prasincs/posit-mobile,trishan/posit-mobile.haiti-commodity,sanyaade-g2g-repos/posit-mobile.android,google-code-export/posit-mobile,sanyaade-g2g-repos/posit-mobile,sanyaade-g2g-repos/posit-mobile,everdefiant/posit-mobile.haiti,trishan/posit-mobile.haiti,sanyaade-g2g-repos/posit-mobile.haiti-commodity,prasincs/posit-mobile,prasincs/posit-mobile,sanyaade-g2g-repos/posit-mobile.web,Raconeisteron/posit-mobile.haiti-commodity,sanyaade-g2g-repos/posit-mobile,Raconeisteron/posit-mobile,everdefiant/posit-mobile.haiti,sanyaade-g2g-repos/posit-mobile.haiti,Raconeisteron/posit-mobile.web,sanyaade-g2g-repos/posit-mobile.android,sanyaade-g2g-repos/posit-mobile.haiti-commodity,everdefiant/posit-mobile.haiti-mobile,trishan/posit-mobile.haiti-commodity,google-code-export/posit-mobile,Raconeisteron/posit-mobile.haiti,everdefiant/posit-mobile,everdefiant/posit-mobile.haiti-commodity,trishan/posit-mobile.haiti-commodity,sanyaade-g2g-repos/posit-mobile.haiti,everdefiant/posit-mobile.haiti-commodity,everdefiant/posit-mobile.haiti-commodity,trishan/posit-mobile.web,everdefiant/posit-mobile.haiti-mobile,everdefiant/posit-mobile.android,Raconeisteron/posit-mobile.haiti-mobile,Raconeisteron/posit-mobile.haiti-mobile,Raconeisteron/posit-mobile.haiti,Raconeisteron/posit-mobile,sanyaade-g2g-repos/posit-mobile.haiti-mobile,everdefiant/posit-mobile.web,everdefiant/posit-mobile.haiti,trishan/posit-mobile.haiti,sanyaade-g2g-repos/posit-mobile.haiti-commodity,Raconeisteron/posit-mobile.haiti-mobile,trishan/posit-mobile,everdefiant/posit-mobile