public static function get()
 {
     if (!isset(self::$instance)) {
         self::$instance = new DbConnect();
     }
     return self::$instance;
 }
Example #2
0
 public static function getInstance()
 {
     if (!self::$instance instanceof self) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Example #3
0
    public static function getInstance()
    {
        if(self::$instance == null)
        {
            $c = __CLASS__;
            self::$instance = new $c;
        }

        return self::$instance;
    }
Example #4
0
 /**
  * Escapes a value to make it safe for using in queries.
  *
  * @param  string  Value to be escaped
  * @param  bool    Do we need to escape this string for a LIKE statement?
  * @return string
  */
 function prepare($value, $do_like = false)
 {
     if (self::$instance == NULL) {
         self::$instance = $this->connect();
     }
     if ($do_like) {
         $value = str_replace(array('%', '_'), array('\\%', '\\_'), $value);
     }
     return self::$instance->real_escape_string($value);
 }