I found a error will debugging some code:
this fonction :
function mrbsGetEntryInfo($id)
{
$sql = "SELECT start_time, end_time, entry_type, repeat_id, room_id,
timestamp, beneficiaire, name, type, description
FROM ".TABLE_PREFIX."_entry
WHERE id = '".$id."'";
$res = grr_sql_query($sql);
if (!$res)
return;
$ret = '';
if (grr_sql_count($res) > 0)
{
$row = grr_sql_row($res, 0);
$ret["start_time"] = $row[0];
$ret["end_time"] = $row[1];
$ret["entry_type"] = $row[2];
$ret["repeat_id"] = $row[3];
$ret["room_id"] = $row[4];
$ret["timestamp"] = $row[5];
$ret["beneficiaire"] = $row[6];
$ret["name"] = $row[7];
$ret["type"] = $row[8];
$ret["description"] = $row[9];
}
grr_sql_free($res);
return $ret;
}
On windows the variable $ret = ''
work fine and when outputting the variable we get the full spectrum from start_time
to description
.
But on Linux CentOS, the function block at $ret=''
only outputting the $ret["type"]
( type is a single char)
the probleme was fix by switching ''
to null
. I don't understand why, I have found this explaining the difference between '' and null
As the topic above say, ''
is a empty string and null
is just a variable with nothing in it. I still don't understand why this fixed the problem.
usefull information :
+------------+------------+--------------+
| | Windows | Linux CentOS |
+------------+------------+--------------+
| OS version | Windows 10 | Centos 7.5 |
+------------+------------+--------------+
| PHP | 7.1.9 | 7.2.11 |
+------------+------------+--------------+
| MySQL | 5.7.19 | 5.7.24 |
+------------+------------+--------------+
| Apache | 2.4.27 | Apache/2.4.6 |
+------------+------------+--------------+