PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I think you took my suggestion a little too literally. You're clearly not making any use of $per_page, $offset, or $query. $query is broken anyways; you need backticks around the column name, not single quotes.
I couldn't say why your initial query isn't working. What does mysql_num_rows($data) tell you? var_dump($data)?