There are two different MySQL extensions in PHP. There's the older [man]mysql[/man] extension which works with all MySQL extensions. Then there's the newer [man]mysqli[/man] extension which works with newer MySQL versions (4.1 and up) with added feature functionality.
Now, with those, you must use their respective functions:
[man]mysql[/man] extension
[indent]mysql_*[/indent]
[man]mysqli[/man] extension
[indent]mysqli_[/indent]
So you can't mix and match. If you want to use mysqli, use mysqli->fetch_assoc or mysqli_fetch_assoc. If you want to use mysql, use mysql_fetch_assoc.
Also, $result is a MySQL resource, not an actual object that you can run methods on. For an object, you'd have to use [man]mysql_fetch_object/man or use the mysqli extension. So running $result->num_rows>0 is doing nothing.