MySQL class
By: fragalot | Date: Apr 26 2009 16:20 | Format: PHP | Expires: never | Size: 2.18 KB | Hits: 1283
- <?php
- /**
- *
- * MySQL wrapper class
- *
- * @author Kerkhove Thomas
- * @copyright Constellation Computers
- * @version 1.2
- */
- {
- class _MySQL
- {
- private $MYSQL_db;
- public $connect;
- private $get_db;
- /**
- * Constructor, connects to the database.
- * ( calls $this->Connect() )
- *
- */
- function __construct()
- {
- }
- /**
- * Connects to the database
- *
- */
- function Connect($MYSQL_host, $MYSQL_user, $MYSQL_pass, $MYSQL_db)
- {
- try
- {
- $MYSQL_host,
- $MYSQL_user,
- $MYSQL_pass
- );
- if($this->get_db == FALSE)
- {
- throw new ErrorException( "Database unavailable", 10, 100);
- }
- }
- catch(Exception $e)
- {
- }
- }
- /**
- * Perform a query
- *
- * @param String $sql
- * @return resource
- */
- function Query( $sql )
- {
- return $que;
- }
- /**
- * Perform a query and return assoc array
- *
- * @param String $sql
- * @return array
- */
- function Fetch( $sql )
- {
- $que = $this->Query( $sql, $this->connect );
- {
- $array[] = $res;
- }
- return $array;
- }
- /**
- * Perform a query and return numrows
- *
- * @param String $sql
- * @return int
- */
- function Num_Rows( $sql )
- {
- }
- /**
- * sanitize variables
- *
- * @param mixed $input
- * @param bool $html (allow html?)
- * @return mixed
- */
- function Clean ( $input, $html = FALSE)
- {
- {
- foreach( $input as $key => $value )
- {
- $output[$key] = $this->Clean( $value );
- }
- }
- else
- {
- {
- }
- if( !$html )
- {
- }
- }
- return $output;
- }
- }
- }
- ?>
Latest pastes
1 hours ago
11 hours ago
1 days ago
2 days ago
2 days ago