I have two while loops running one after the other (not inside of each other) - I\'ve simplified the code a bit so that only the important parts of it are listed below. The
You've already looped through the result rows, so it's at the end and returns FALSE. (That's why it exited the loop the first time.)
FALSE
To reset the internal pointer to the beginning of the result set, use mysql_data_seek().
mysql_data_seek($result_work_id, 0);