File: bench1.php

package info (click to toggle)
odontolinux 0.6.1-6
  • links: PTS
  • area: main
  • in suites: woody
  • size: 1,128 kB
  • ctags: 566
  • sloc: php: 4,137; sh: 262; makefile: 46
file content (36 lines) | stat: -rw-r--r-- 1,252 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?

function tira_fuori ($tab) {
			   $dbserver = "127.0.0.1";
			   $dbport   = "5432";
			   $database = "odontolinux";
			   $conn = pg_Connect("host=$dbserver port=$dbport dbname=$database ");
				   if (!$conn) {
			                       echo "Si &egrave; verificato un errore.\n";
			                       exit;
			                     } // Errore accesso al database
			   pg_Exec($conn,"SET DATESTYLE TO 'European';");
			   $esito = pg_Exec($conn, "SELECT * FROM $tab  WHERE id LIKE '1';");
		                   if (!$esito) {
			                      echo "Si &egrave; verificato un errore.\n";
			                      exit;
			                     } // Errore interrogazione database yes
			   $numerorighe = pg_NumRows($esito);
			   return array ($numerorighe, $esito);
		            }

list ($num, $esi) = tira_fuori ("anagrafica");
echo $num;
echo $esi;

//   $i = 0;
//   while ($i < $num) {
//                      echo "<B>";
//                      echo pg_Result($esito, $i, "cognome");
//                      echo "&nbsp;";
//                      echo pg_Result($esito, $i, "nome");
//                      echo "</B>";
//                      $i++;
//                     } // Estrazione delle righe dell'interrogazione

?>