Page 1 of 1

Checking if things exist (not variables)

Posted: Sun Oct 19, 2003 7:11 pm
by Gen-ik
Does anyone know if PHP can check if certain Libraries and Objects exist?

For example could PHP check if had been compiled with the GD or SQL libraries... or check if a MySQL database exists on the server (of even if a MySQL server exists on the host) ?

I can check if classes exist now which is good, and very helpful, but the stuff listed above I have no idea about (even though I've been using PHP for about 2 and a half years) :oops:








I'm taking a wild guess I've just made myself look really stupid.







Right......... I'm off to beat myself with a large stick.

Posted: Sun Oct 19, 2003 7:21 pm
by volka
http://php.net/manual/en/function.extension-loaded.php

for the database tests you might use the error number returned by mysql_errno at each stage.