<!DOCTYPE  HTML  PUBLIC  "-//W3C//DTD  HTML  4.0  Transitional//EN"  "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>DBMS example 1</title>
<link href="/styles/cs1.css" rel="stylesheet">

</head>
<body>
<h1>Simple Query: uses result all</h1>

<p>See the <a href="http:dbdemo1.phps">source</a> or<a href="dbdemo1.phtml"> open the file</a>

<?php
    
    
//we don't need a username & password when tables are accessible to web
    
    
$user="";
    
$upasswd="";
    
$dsn "DBMS";  // $dsn is the name of the db2 database

    
$query "select * from CIS3311.VENDOR order by VEN_CODE";
    print 
"<p>query is: <code>$query</code><br>";
    
//connect 
   
    
$conn = @odbc_pconnect($dsn$user,$upasswd ); 

    if (!
$conn) {
        print 
"Connection failed\n</html>";
        exit;   
    }
     if (
$result odbc_Exec($conn$query)) {
        print 
"Query returned : " odbc_num_rows($result) . " rows";
        
odbc_result_all($result"border = 1");
    }
?>
<hr>
<p align=center>
<a href="demos.phtml">Demos</a> | <a href="dbdemo2.phtml">dbdemo2</a>
</p>
</body></html>