Acessardados Aula7

393
-1

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
393
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
35
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Acessardados Aula7

  1. 1. new 3 quinta-feira, 26 de fevereiro de 2009 13:45 ACESSARDADOS.PHP <!DOCTYPE html PUBLIC quot;-//W3C//DTD XHTML 1.0 Transitional//ENquot; quot; http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdquot;> <html xmlns=quot;http://www.w3.org/1999/xhtmlquot;> <head> <meta http-equiv=quot;Content-Typequot; content=quot;text/html; charset=utf-8quot; /> <title>Untitled Document</title> </head> <?php class AcessarDados { var $dbName = quot;clinicaquot;; function conectar ($hostname, $username, $password){ $conexao = mysql_pconnect($hostname, $username, $password); mysql_select_db($this->dbName); return $conexao; } function inserirAmbulatorio ($andar, $capacidade, $conexao){ $sqlquery = quot;INSERT INTO clinica.ambulatorios (andar,capacidade) values ('quot;.$andar.quot;','quot;. $capacidade.quot;')quot;; $result = mysql_query($sqlquery, $conexao); return $result; } function inserirPacientes ($nome, $idade, $doenca, $cpf, $cidade, $conexao){ $sqlquery = quot;INSERT INTO pacientes (nome, idade, doenca, cpf, cidade) values ('quot;.$nome. quot;','quot;.$idade.quot;','quot;.$doenca.quot;','quot;.$cpf.quot;','quot;.$cidade.quot;')quot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarPacientes ($conexao){ $sqlquery = quot;SELECT * FROM clinica.pacientesquot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarAmbByFiltro($campo, $valor ,$conexao){ $sqlquery = quot;SELECT * FROM ambulatorios where $campo='quot;.$valor.quot;';quot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionar($tabela,$conexao){ $sqlquery = quot;SELECT * FROM quot;.$tabela; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarConsultas ($conexao){ -1-
  2. 2. new 3 quinta-feira, 26 de fevereiro de 2009 13:45 $sqlquery = quot;SELECT * FROM clinica.consultasquot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarFuncionarios ($conexao){ $sqlquery = quot;SELECT * FROM clinica.funcionariosquot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarMedicos ($conexao){ $sqlquery = quot;SELECT * FROM clinica.medicosquot;; $result = mysql_query($sqlquery, $conexao); return $result; } function selecionarAmbulatorios ($conexao){ $sqlquery = quot;SELECT * FROM ambulatoriosquot;; $result = mysql_query($sqlquery, $conexao); return $result; } function encerrarConexao ($conexao) { mysql_close($conexao); } } ?> <body> </body> </html> -2-

×