Skip to Content.
Sympa Menu

freetds - Re: whither goest PHP sample?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "James K. Lowden" <jklowden AT speakeasy.org>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: whither goest PHP sample?
  • Date: Sat, 21 Apr 2001 00:12:44 +0000

Brian Wilson wrote:

> Has anyone seen this file 'odbctest.php'? My 0.51 'samples' directory
> has only a single file called "debug.c". 0.50, 0.47, 0.46 all had
> more files, but still all just *.c stuff; it looks like they are test
> files, not samples. Does the project needs some sample files???

Brian,

I fetched from the CVS a few weeks ago. I have a file
freetds/samples/odbctest.php
among 8 files in that directory. I've attached it.

If your source is more recent, let me know and I'll fix the user guide (or
wait for
someone to correct the source archive). Can't help further, though; don't
know beans
(as it were) about PHP.

HTH.

--jkl
<?
// connect to a DSN "mydb" with a user and password "marin"
$connect = odbc_connect("JDBC", "guest", "sybase");

// query the users table for name and surname
$query = "SELECT * from sysusers";


// perform the query
$result = odbc_exec($connect, $query);


// fetch the data from the database
while(odbc_fetch_row($result)){
$suid = odbc_result($result, 1);
$uid = odbc_result($result, 2);
$gid = odbc_result($result, 3);
$name = odbc_result($result, 4);
print("$name|$suid|$uid|$gid\n");
}

// close the connection
odbc_close($connect);
?>


  • whither goest PHP sample?, Brian Wilson, 04/20/2001
    • <Possible follow-up(s)>
    • Re: whither goest PHP sample?, James K. Lowden, 04/21/2001

Archive powered by MHonArc 2.6.24.

Top of Page