list($nr_rows) = @mysql_fetch_row Firstly, why are you using list instead of just $nr_rows = @mysql_fetch_row etc. Secondly, that will return an array, empty() is for checking if a string is empty. An empty array, if I recall, will still return a string value of Array (). Thirdly, SELECT COUNT(*) doesn't return a row, it returns a value/result. You would be best using mysql_fetch_result($query, 0) perhaps. Lastly, You are suppressing the error messages using @ but are not providing an alternative. Without an alternative, you are not going to see what the actual error is. That is a part of why nesting queries is a very bad idea, as well as the performance issues of using mysql_fetch_row regardless of whether mysql_query actually worked correctly etc. Dest