Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*By Jordi H. Castro*/
- class sql
- {
- var $servidor;
- var $usuario;
- var $password;
- var $database;
- var $enlace;
- public function info_servidor($servidor, $usuario, $password, $database){
- $this->servidor=$servidor;
- $this->usuario=$usuario;
- $this->password=$password;
- $this->database=$database;
- }
- function enlace(){
- $this->enlace =mysql_connect($this->servidor, $this->usuario, $this->password);
- mysql_select_db($this->database);
- }
- public function prueba_enlace(){
- return mysql_info($this->enlace);
- }
- }
- $sql =new sql();
- $sql->info_servidor('localhost', 'root', 'jordis99', 'test');
- echo $sql->prueba_enlace();
Add Comment
Please, Sign In to add comment