More code. with code link in editor

More code. with code link in editor

3:25 PM 3/29/2016
// ======================================================above put simple query.

MAX(IF(field_name='_hdp', field_value, NULL )) AS '_hdp',
$_hsSubmits = `db295107664`.`hs_submits`;

/*
$query= "SELECT
MAX(DATE_FORMAT(FROM_UNIXTIME(submit_time), '%b %e, %Y %l:%i %p')) AS Submitted,
max(if(`field_name`='semKey1', `field_value`, null)) AS 'semKey1',
max(if(`field_name`='semKey2', `field_value`, null)) AS 'semKey2',
GROUP_CONCAT(if(`file` is null or length(`file`) = 0, null, `field_name`)) AS 'fields_with_file'
FROM `db295107664`.`hs_submits`
WHERE form_name ='jammas'
GROUP BY `submit_time`
ORDER BY `submit_time` DESC
LIMIT 0, 5
";
echo "BB";
//================================================try resultd

if ($result = $mysqli->query($query, MYSQLI_USE_RESULT)) {
if (!$mysqli->query("SET @a:='this will not work'")) {
printf("Error: %s\n", $mysqli->error);
}
$result->close();
}
// fetch object array

while ($obj = $result->fetch_object()) {
printf ("%s (%s)\n", $obj->semKey1, $obj->semKey2);
}

$result= mysqli_query($query) or die(mysqli_error());
while ($row = mysqli_fetch_array($result)) {
echo $row['Submitted']." : ".$row['semKey1']." : ".$row['semKey2']."";
echo "===============";
echo $row['fields_with_file'];
echo "";
}
echo "RR";
# while($row = mysql_fetch_array($result))
# {
# echo $row['Submitted']." :: ". $row['field_name'] . " :: ". $row['field_value'] . " :: ". $row['field_order']. "";
# echo $row['semKey1'] . "....." . $row['semKey2'] ."";
# }
// echo $result;
*/
echo " ";
?>
end