PHP Outputting null
<p><br>
<b>My script:</b><br>
-its a part of a ajax call, it is returned as a JSON response and is being packed in an array();
<br>
<b>my code should do:</b><br>
-Return some div's and info from the users last activity's 
<br>
<b>My problem:</b><br>
-This code below, is not returning any value(null) though it should return the values of the users activity's <br>
-It doesn't come up with any error's, so all variables and functions is working as they should.
<br></p>

<pre><code>    $response = array();
    include("lang/en_gb.php"); //defines TOP_5_2_2, TOP_5_2_1, TOP_5_1_1 and TOP_5_1_2
    $ownerid = $_POST['ownerid'];
    foreach ($db-&gt;query("SELECT * FROM activities WHERE ownerid='$ownerid' AND check='seen' ORDER BY id DESC LIMIT 10") as $row) {
       $aid = $row['activityid'];
       $id = $row['userid'];

        foreach ($db-&gt;query("SELECT * FROM users WHERE id='$id'") as $row2) {
        $type = $row['type'];
        if($type == "likecomment"){$fill1 = TOP_5_2_1; $fill2 = TOP_5_1_2;}else if($type == "likestatus"){$fill1 = TOP_5_2_1; $fill2 = TOP_5_1_1;}else if($type == "statcom"){$fill1 = TOP_5_2_2; $fill2 = TOP_5_1_1;}
        $string2 = $string2."&lt;div class='notiflink'&gt;&lt;div class='notifLinkLeft'&gt;&lt;a href='user.php?id=".$row2['id']."'&gt;&lt;img src='".$row2['picture']."' /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class='notifLinkCenter'&gt;&lt;span class='notifLinkCenterCont'&gt;&lt;a href='user?id=".$row2['id']."'&gt;".$row2['firstName']." ".$row2['lastName']."&lt;/a&gt; ".$fill1." &lt;a href='post?id=".$aid."'&gt;".$fill2."&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;";
        }
    }
   $response['activityText'] = $string2;
   echo json_encode($response);
</code></pre>

<p><br>
<b>What i have tried:</b><br>
-singel and double qouting TOP_x_x_x to 'TOP_x_x_x'/"TOP_x_x_x"<br>
-make switch with the if statements where the fill's are.<br>
-making the defines, TOP_x_x_x into variables instead.<br></p>
