On both your mysql_connect and mysql_select_db functions you have "or die(mysql_error()). If something goes wrong. this little bit of code is going to let you know. If you don't see any messages then you can just assume your connection is successful.
Also I don't recommend ever using "SELECT *" in your queries unless you really need to select every single column in a table because it's a waste of CPU cycles and probably RAM too. The more your site wastes computer "power," if you will, the less people your site will be able to handle on it at one time. The alternative to "SELECT *" is listing the columns you want e.g. on an employee table I might do "SELECT `employee_name`, `employee_id`, `department_id`"
Anyway, I'm not entirely sure if my advice about this next part is the best advice, but what I would have personally done is an entirely separate query for "Tooltip". If someone has a better idea, they'll probably come along and correct me. I am an intermediate PHP programmer so and they're, like, pros, so yeah.
The better I get at programming, the more I appreciate arrays. Handy dandy things they are.
One reason I can see that might be your problem is that you're iterating through the same resultset twice, the second time obviously starting at the end of the recordset and immediately returning false.
You could either try and extract both fields of information at the same time and store it in an array for further processing, or rewind the recordset using mysql_data_seek: