Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- DEFINE ("SQL_HOST","localhost");
- DEFINE ("SQL_BDD","test_mysql_class");
- DEFINE ("SQL_USER","root");
- DEFINE ("SQL_PASSWORD","k1985p");
- class MySQL {
- var $Host = SQL_HOST;
- var $Database = SQL_BDD;
- var $User = SQL_USER;
- var $Password = SQL_PASSWORD;
- function __construct() {
- $this->db = mysql_connect($this->Host, $this->User, $this->Password);
- $SelectResult = mysql_select_db($this->Database, $this->db);
- if(!$SelectResult) {
- echo "Ошибка подключения";
- }
- }
- function Select($query){
- return $this->Query = mysql_query($query);
- }
- function fetch_object(){
- return mysql_fetch_object($this->Query);
- }
- function InsUpdDel($query){
- $this->Query = mysql_query($query) or die(mysql_error());
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement