Access denied for user: '@sub19-180.member.dsl-only.net' to database 'jokes'
That looks like some host name or IP or something.
Is that the value you are using for $user?
Realize that your username for MySQL and for the server are different. (sorry if you already knew).
What OS are you operating on?
If you can, get a GUI administration tool.
Can you use phpmyadmin?
If you can get into that, use the same username and password for your connection.
In the file: my.ini,
you can set:
user=username
password=pass
Use those same values in your connection script.