php - Use each row as a get variable for include? -


i'm working on notification system , want use kind of platform i've built viewing profiles id's found in database 'friendships' (which keeps track of sender, recipient , date of friendship request)

i've been trying find way include profile module (which uses $_get variable fetch user information), every row, , need way set variable each row , include module using id, when try this, 1 appears instead of 4 requests have.

while ($row = mysqli_fetch_assoc($result)) {     echo "<div class='item friend'>";      $_get['user'] = $row['sender_id'];     $path = $_server['document_root'];     $path .= "/profile/module.php";     include_once($path);      echo "</div>"; } 

i aware setting variable wrong, don't have clue how go doing this.

update: after applying gautum rai's code, correct of divs showing, appear empty.

this html generates once use original code (which echoes info of 1 person).

<div class="item friend"> <div class="profile">     <img class="pic" title="taswell: omikron player" style="background-image: url("/img/badges/omikron.png") !important;" src="/uploads/profile19.jpg?" 2147213591="">     <p class="username">mynameisknuckles<img class="medal" src="/img/medals/dragonfly.png" title="queen of hive"></p><br>     <p class="bio playing">nothin. waiting next omikron build.</p> </div> 

note: asked similar this, got comments telling me join variables or not use while loop fetch assoc. please provide relevant answer, appreciate that.

you susing include_once explicit including file once, , filename same. try using include.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -