Checking if things exist (not variables)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Gen-ik
DevNet Resident
Posts: 1059
Joined: Mon Aug 12, 2002 7:08 pm
Location: London. UK.

Checking if things exist (not variables)

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
Post Reply