• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Acessardados Aula7
 

Acessardados Aula7

on

  • 590 views

 

Statistics

Views

Total Views
590
Views on SlideShare
579
Embed Views
11

Actions

Likes
0
Downloads
34
Comments
0

2 Embeds 11

http://phpmysql20091.blogspot.com 10
http://www.phpmysql20091.blogspot.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Acessardados Aula7 Acessardados Aula7 Document Transcript

    • 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-
    • 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-