Jump to content

Include once??

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
2 replies to this topic

#1
Chan

Chan

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 204 posts
I have a file, mysql.php, that connects to the database. However, I have other files that use mysql.php that are also included in more files that also have mysql.php included.

IE:

index.php -> has mysql.php and config.php
config.php also has mysql.php

I'm getting an error when using mysql functions. Is there a way to only include once in php?

#2
John

John

    Writes binary right handed and hex left handed

  • Moderators
  • 6,321 posts
Like this?

PHP: include_once - Manual

#3
Guest_Jordan_*

Guest_Jordan_*
  • Guests
Nice Link Sidewinder. I always find it helpful to search php.net for functions, that is the best place to start with for looking up information.