forked from vscarpenter/webSqlApp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getModifiedContact.php
38 lines (31 loc) · 1.29 KB
/
getModifiedContact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
// Name : getModifiedContact.php - called by webSqlSyncAdapter.php
// Goal : To communicate data from a MySQL query to a webSqlSync json format.
// By (c) : Alain Beauseigle de AffairesUP inc.
// Version: 2013-10-19
// To do : Successful unit test, but to debug after integration
// For unit test: http://www.affairesup.com/webSqlApp/getModifiedContact.php
// To test the query: $clientLastSyncDate = 0;
//include "loginCheck.php";
//if ($CLnum_rows){
// switch ($_REQUEST['Version']){
// case $KEY_RDNET:
/* $query = "SELECT *"
." FROM Contacts"
." ORDER BY id ASC ";
*/
//echo "clientLastSyncDate", $clientLastSyncDate; // For the first sync, it equal zero
require_once('connections/connDbUP.php');
$query = "SELECT * FROM Contacts WHERE last_sync_date > '". $clientLastSyncDate ."' ORDER BY id DESC ";
//echo $query;
//Note: $clientLastSyncDate comes from webSqlSyncAdapter.php line 41: $clientLastSyncDate = $clientData['info']['lastSyncDate']/1000;
$sql_result = array();
$sql = mysql_query($query);
while($row = mysql_fetch_object($sql)){
$sql_result[] = $row;
}
//print_r ($sql_result); //R: Good array result, but the result is not passed to the adapter
return $sql_result;
//echo $sql_result;
//} end if ($CLnum_rows) used for authentication
?>