Back to Programming Articles

phpinclude tip (for running queries)
by Black Vivi 03 May 2003

the main problem with phpinclude is running queries, it runs them on every page, even if they're not needed...

using the following you can make it so tey're only ran on certain files:
PHP Code:
if ($PHP_SELF == "/full/files/path/and/file/name/and.extension") {
    
$DB_site->query("YOU\'RE QUERY HERE");

obviously you have to replace a few things (like the file path)

hope it helps some of you

vblts.ru supports vBulletin®, 2022-2024