Please provide the screenshot of the phpinfo place where it says that you have 5.1 version
But if you connect empty database it will cause error. What are you trying to achieve?
right after <?php tag put this phpinfo();
save the file
go to your website and refresh it, now you'll see the phpinfo
ctrl+f and search for mysql
You should get to the MySQL block look up for Client Api version in the mysql block, What version is it?