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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.