note 51960 added to function.mysql-connect

From: Date: Sun, 17 Apr 2005 06:13:02 +0000
Subject: note 51960 added to function.mysql-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-88096@lists.php.net to get a copy of this message
Um exemplo de classe de conexão para quem fala Português: <? class bd{ var $bd; var $id; function bd($banco){ $this->bd = $banco; } function conecta($servidor,$database,$usuario,$senha){ $dsn = 0; if($this->bd == "mysql"){ if($this->id = mysql_connect($servidor, $usuario, $senha)){ mysql_select_db($database,$this->id); } else{echo "Falha na conexao do banco de dados"; } } else{ if($this->bd =="mssql"){ $this->id = new COM("ADODB.Connection"); $dsn = "DRIVER={SQL Server}; SERVER={".$servidor."};UID={".$usuario."};PWD={".$senha."}; DATABASE={".$database."}"; $this->id->Open($dsn); } else{$this->id = 0;} } } } ?> ---- Manual Page -- http://www.php.net/manual/en/function.mysql-connect.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+51960 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51960&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51960&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51960&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51960&report=yes&reason=useless Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51960&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+51960&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#88096) next »