public static function Execute() { self::SetStatement(); self::ExecuteStatement(); Debug::Set('Sql (' . self::GetRowsAffected() . ' rows): ' . self::$_sql); if (self::$_name) { Data::SetName(self::$_name); Data::Set(self::$_statement->fetchAll(PDO::FETCH_ASSOC)); } self::$_name = null; }
public static function Setup() { Debug::Set('Database setup initiated'); self::SetType('mysql'); self::SetHostname('localhost'); self::SetUsername(getenv('TEST_USERNAME')); self::SetPassword(getenv('TEST_PASSWORD')); self::SetPort('3306'); self::SetDefaultDatabase('test'); Debug::Set('Database type: ' . self::GetType()); Debug::Set('Database host: ' . self::GetHostname()); Debug::Set('Database username: ***************'); Debug::Set('Database password: ***************'); Debug::Set('Database port: ' . self::GetPort()); Debug::Set('Database default database: ' . self::GetDefaultDatabase()); try { self::SetConnection(new PDO(self::GetType() . ': host=' . self::GetHostname() . '; port=' . self::GetPort() . '; dbname=' . self::GetDefaultDatabase(), self::GetUsername(), self::GetPassword())); self::SetConnectionStatus('ok'); Debug::Set('Database connection SUCCESS'); } catch (PDOException $e) { self::SetConnectionStatus($e->getMessage()); Debug::Set('Database connection FAILED'); } }
public function Setup() { \Donsapp\Debug::Set('Page setup initiated'); \Donsapp\Sql::ExecuteSql(' SELECT * FROM don_log ; '); // echo "<br> asd ROW 0 = " . \Donsapp\Sql::GetField('ip_addr'); }
public static function Set($x) { self::$_results[self::$_name] = $x; \Donsapp\Debug::Set('Stored named query: ' . self::$_name); self::$_name = ''; }