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
According to your posted code, your SQL will look something like:
SELECT title FROM works WHERE OR '1'
That query will result in an error so your script shouldn't be getting past that point.
Even if it does, your second loop:
while ($row = mysql_fetch_assoc($result_work_id))
is using a result handle that has already been completely iterated by the first loop. By the the time the second loop tries to use it, mysql_fetch_assoc
will return FALSE
because there are no more rows to fetch. This will cause the second loop to exit immediately.
If both while
loops need to access the same rows, combine their logic so the rows only need to be iterated over one time.