$cnx = odbc_connect( 'DSN' , 'USER', 'PASS' );
    if (!$cnx) {
        ?>Could not connect to ODBC<?
 $cur= odbc_exec( $cnx, "SELECT Vehicle.Vehicle_ID, Vehicle.Cust_ID FROM
Vehicle" );
    if (!$cur) {
        Error_handler( "Error in odbc_exec( no cursor returned ) " , $cnx );

    // fetch the succesive result rows
    while( odbc_fetch_row( $cur ) ) {

        // Assign results names
        $Cust_Id= odbc_result($cur,2);
        $Vehicle_ID= odbc_result($cur,1);
#code Here

-----Original Message-----
From: J.M. Cocchini [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 16, 2003 4:01 PM
Subject: [PHP-DB] Newbie Question - PHP and MSACCESS


Am using php to open a customer's msaccess file.

First time for everything.  It's a very small database of less then 25
rows, and will always be this small.

Am needing to return all the rows to a web page using php at all times.
Very simplistic.

Am apparently set up correctly on the DSN, and am able to do an

$connection = odbc_connect("meetings","","");

Am able to fetch rows, or so it seems:

$result = odbc_do($connection,"select * from events where id=$id");

Am not understanding how to "print()" the fields in the rows, one after
the next, on the same line, and then do the same with the next record,
until all records have been presented.

Sorry to be lame.  Any help would be gratefully received.


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to