Jump to content

--php mysql join outputs only one row--


antonyfal

Recommended Posts

Hi

Im new to "join" function this is my first attempt.. My example below only outputs the first tab/row. I need all the data output.. the "rel" below seems correct to the one tab loaded..

 

if(isset($_GET['loadLists']))

{

if($needAuth == 1 && !is_logged()) return 'you must be logged in to view this list.';

$current_user_id = (__isset('multiuser') == 1)?intval($_SESSION['userid']):0;

 

$q = $db->dq("SELECT * FROM todo_lists INNER JOIN todo_lists_setting

ON todo_lists.id=todo_lists_setting.list_id WHERE todo_lists_setting.user_id = '$current_user_id'");

 

while($row = $q->fetch_assoc($q)) // same as mysql_fetch_assoc

{

echo '<li id="list_'.$row['id'].'" rel="'.$row['notify'].'_'.$row['showcompl'].'_'.$row['sorting'].'_'.$row['shownotes'].'_'.$row['showdates'].'" class="ytt-tabi"><a href="#list/'.$row['id'].'" rel="'.$row['id'].'" title="'.htmlarray($row['name']).'"><span>'.htmlarray($row['name']).'</span></a></li>';

}

}

Link to comment
https://forums.phpfreaks.com/topic/277790-php-mysql-join-outputs-only-one-row/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.