I have a weird problem. I read all related topic but there was no any solution for me. There are bunch of php codes on my project and all work perfectly but that one :
<?php
require("connection.php");
$query = "SELECT * FROM mrf WHERE completed=0 AND archive IS NULL ORDER BY projectname";
$get = $db->prepare($query);
$get->execute();
if ($get->rowCount()!=0){
foreach ($get as $res) {
'<li class="list-group-item"><span class="font-weight-bold">Product(s) : </span>';
$pieces = explode(",", $res['products']);
$pieces_count = count($pieces);
for ($i=0; $i <= $pieces_count -1 ; $i++) {
$query2 = "SELECT * FROM suppliers WHERE id = :id";
$get2 = $db->prepare($query2);
$get2->bindValue(":id",$pieces[$i]);
$get2->execute();
if ($get2->rowCount()!=0){
foreach ($get2 as $res2) {
echo $res2['name'].'<b>/</b>';
}
}
}
echo '</li>';
It works localhost perfectly but on server the result is empty.
-
I have checked the error(s)
error_reporting(E_ALL); ini_set('display_errors', 1);
But there is no any error. Also If there had been an error, I would have seen it on localhost, because error_reporting works on localhost as well as on live server.
- I checked typos, no any typo
Checked cpanel everything related to PHP. All is OK. By the way php ver is 5.6
Any idea??
-----------------------------------RESULT----------------------------
-I have checked all codes again and didn't find any error. -I contacted my hosting company. They said my server has reached RLimitMEM (don't know what it is) So they increased my RlimitMEM value. - I amnot satisfied with hosting company's answer but the code is working now. - I appreciate for all answers and advices.