Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class CMySQL
- {
- public static function Connect($host = "localhost", $user = "", $password = "")
- {
- return mysql_connect($host, $user, $password);
- }
- public static function Select($link = NULL, $databaseName = "")
- {
- if($link == NULL or !is_resource($link)) { return false; }
- return mysql_select_db($databaseName, $link);
- }
- public static function Query($link = NULL, $query = "")
- {
- if($link == NULL or !is_resource($link)) { return false; }
- return mysql_query($databaseName, $link);
- }
- public static function Num($link = NULL)
- {
- if($link == NULL or !is_resource($link)) { return false; }
- return mysql_num_rows($link);
- }
- public static function Fetch($link = NULL)
- {
- if($link == NULL or !is_resource($link)) { return false; }
- return mysql_fetch_assoc($link);
- }
- public static function InsertID($link = NULL)
- {
- if($link == NULL or !is_resource($link)) { return mysql_insert_id(); }
- return mysql_insert_id($link);
- }
- public static function Close($link = NULL)
- {
- if($link == NULL or !is_resource($link)) { return false; }
- return mysql_close($link);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement