Always, always, always place your query into a variable first so you can echo it out and see what's going on when things (inevitably) go wrong.
$sql="SELECT *,DATE_FORMAT(lastlogin,'%d-%m-%y %H:%i') as datum FROM users WHERE active='' or approved='' ORDER BY uid LIMIT $limitvalue,$nrrowsuser";
$res=mysql_query($sql);
It could be one of a few things, the easiest way to find out is to take a look at exactly what's being run and prehapse run it yourself from the command line.
HTH
Bubble