[PHP] Connect to IBM DB2

2002-01-02 Thread Jerry

To connect to Microsoft SQL 7 I'm using the following script which works
fine:

?php
$query=SELECT * FROM DB1;
$queryupd=UPDATE DB1 SET dateval='20010101' where dateval='2101';
$hostname = dbserver;
$username = username;
$password = pwd;
$dbName = DB;
mssql_connect($hostname,$username,$password) or die(DATABASE FAILED TO
RESPOND.);
mssql_select_db($dbName) or DIE(Table unavailable);
$result2 = MSSQL_QUERY($queryupd); // Execute Update Statment
$result = MSSQL_QUERY($query);  // Execute Select Statment
$number = MSSQL_NUM_ROWS($result);
$i=0;
 if($number == 0) print No data?;
 elseif($number  0){
 print Number of rows: $numberBR;
while($i  $number){
 $dateval = mssql_result($result,$i,dateval);
echo TRTDFONT color=#112266$dateval/FONT/TD;
 $i++;}
}
?

Now, how to connect to a DB2 database server without ODBC ?

My config is:
Web Server: IIS on windows 2000 Server
Database Server: IBM DB2 V7.1 on windows 2000 Server
PHP4 for windows

Thanks.

Jerry



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Connect to IBM DB2

2002-01-02 Thread David Jackson

Jerry --
I didn't see any functions listed in:
http://www.php.net/manual/en/

for DB2 the ODBC maybe you only answers, heres the link:
http://www.php.net/manual/en/ref.odbc.php

David



 To connect to Microsoft SQL 7 I'm using the following script which
 works fine:
 
 ?php
 $query=SELECT * FROM DB1;
 $queryupd=UPDATE DB1 SET dateval='20010101' where dateval='2101';
 $hostname = dbserver;
 $username = username;
 $password = pwd;
 $dbName = DB;
 mssql_connect($hostname,$username,$password) or die(DATABASE FAILED TO
 RESPOND.);
 mssql_select_db($dbName) or DIE(Table unavailable);
 $result2 = MSSQL_QUERY($queryupd); // Execute Update Statment
 $result = MSSQL_QUERY($query);  // Execute Select Statment
 $number = MSSQL_NUM_ROWS($result);
 $i=0;
 if($number == 0) print No data?;
 elseif($number  0){
 print Number of rows: $numberBR;
 while($i  $number){
 $dateval = mssql_result($result,$i,dateval);
 echo TRTDFONT color=#112266$dateval/FONT/TD;
 $i++;}
 }
 ?
 
 Now, how to connect to a DB2 database server without ODBC ?
 
 My config is:
 Web Server: IIS on windows 2000 Server
 Database Server: IBM DB2 V7.1 on windows 2000 Server
 PHP4 for windows
 
 Thanks.
 
 Jerry
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail:
 [EMAIL PROTECTED]


-- 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]