The mysql_*()
functions won’t work after WP 3.9, so don’t use them. See Make WordPress Core entry MySQL in WordPress 3.9. It is adviced to use $wpdb
methods instead – if necessary.
In your case – as far as I can tell – it isn’t necessary at all. You can use the relevant API functions for User Meta data, namely, regarding your code, get_user_meta()
.
Using available API functions makes your life as developer much easier, in terms of maintainability of your code. So I strongly advice it, whenever you can.