RE: Newbie Question - PHP and MSACCESS

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



$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 ) ) {
        $nbrow++;

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



-----Original Message-----
From: J.M. Cocchini [mailto:jcocchin@comcast.net]
Sent: Sunday, February 16, 2003 4:01 PM
To: php-db@lists.php.net
Subject:  Newbie Question - PHP and MSACCESS


Hi,

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
odbc_connect:

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

Am able to fetch rows, or so it seems:

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

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.


-Joe


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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux