Reply to Problem With Inner Loop

Your name:

Reply:


Posted by "Shaun" on 10/10/28 11:25

Hi,

The following code is attempting to display a list of work types for all the
users in my database. However it only loops through the inner loop once and
I can't work out why, can anyone help here please?

Thanks for your help

<table>
<?php
include('application.php');
$staff_qid = mysql_query('SELECT
U.User_ID,
CONCAT_WS(" ", U.user_Firstname, U.User_Lastname) AS "User_Name"
FROM Users U, Allocations A, Projects P
WHERE U.User_ID = A.User_ID
AND A.Project_ID = P.Project_ID
AND P.Project_ID = 38
AND (U.User_Type = "Staff"
OR U.User_Type = "Manager"
OR U.User_Type = "Administrator")
ORDER By User_Name');
$work_type_qid = mysql_query('SELECT
Work_Type_ID,
Work_Type
FROM Work_Types
WHERE Project_ID = 38
ORDER BY Day_Type');
?>
<table>
<?php while( $staff_r = mysql_fetch_object( $staff_qid ) ) { ?>
<tr>
<?php while( $work_type_r = mysql_fetch_object( $work_type_qid ) ) { ?>
<td><?php echo $work_type_r->Work_Type; ?></td>
<?php } ?>
</tr>
<?php } ?>
</table>

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация