see the documentation for info and an example of how to use a function.
youre getting that error because you didnt pass a link to the function. as the manual sais, if you dont pass a link, it uses the last opened connection. if you didnt open a connection, it tries to create one so it can close it(pointless).
solution? dont use the function unless you have a connection to be closed, or just dont even close it, php will do it for you.
read the manual.