我試着去選擇正確的用戶名,但由於某種原因,它一直在myphpadmin選擇第一個用戶名不會選擇了正確的用戶名數據
<?php
if (logged_in() === true) {
$item = array(
'<li id="item_0"><a href="../../index.php">Home</a></li>',
'<li id="item_1"><a href="../../music.php" >Music</a></li>',
'<li id="item_2"><a href="../../pictures.php">Pictures</a></li>',
'<li id="item_3"><a href="../../poertry.php">Poertry</a></li>'
);
$db->query("SELECT * FROM `menusort` WHERE '$user_data[username]'
= username");
$order = $db->get();
$order = explode(',', $order[0]['data']);
foreach($order as $key => $value) {
echo $item[$value];
};
} else {
echo '<li><a href="../../index.php">Home</a></li>
<li><a href="../../music.php" >Music</a></li>
<li><a href="../../pictures.php">Pictures</a></li>
<li><a href="../../poertry.php">Poertry</a></li>';
}
?>
我試試看,相同的問題 –
@PabloLopez用''echo'暫時替換''db-> query'',其餘的從''$ order = $ db-> get();''to ''foreach''結尾並複製輸出... – thedom
好的謝謝你的幫助 –