[PHP] odbc_connect() without user and password

2011-06-21 Thread Marten Lehmann

Hi,

I'd like to specify the credentials rather in the application specific 
.odbc.ini than in the source code. I also don't like to create config 
file parsing overhead.


Why isn't the the user and password parameters in odbc_connect() 
optional? The unixODBC test tool isql works fine without specifying 
credentials, ie. it takes them automatically out of the odbc.ini if 
available.


Kind regards
Marten

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



[PHP] odbc_connect

2003-06-18 Thread Wim Paulussen
LS,

I try to get connected to a MSSQL via ODBC (setup with Windows
authentication) , but this is the error I get.

Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login
failed for user 'NT AUTHORITY
\ANONYMOUS LOGON'., SQL state 28000 in SQLConnect


Anyone any ideas ?

Thx,
Wim



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



[PHP] odbc_connect and segmentation fault

2003-03-28 Thread Joel Vorpagel
Can anyone help me out? I'm running PHP 4.3.1 on
Apache 1.3.23 with unixODBC 2.2.3. I'm using ODBC to
connect to my db2 database. I was testing out some
scripts that connect to a database to run select and
insert statements. When I run the scripts on my test
site (through the browser) everything appears to work
fine. The data is displayed, the insert works and the
scripts seem to work from start to finish. However,
when I run my script from the command line I get the
correct output - but after that I receive a
segmentation fault. I think the odbc_connect statement
is causing this. When I test this out on a simple php
script (that only creates a connection to the db
through odbc_connect), it causes a segmentation fault
when run from the command line. Does anybody have any
ideas or know the resolution?

Thanks in advance!

Joel

?php   
putenv(DB2INSTANCE=db2inst1);
$conn = odbc_connect('DB','User', 'Pass');

if ($conn = 0)
{
   echo Connection not set;
}
?

__
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

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



[PHP] odbc_connect vs. DB2 (Connection speed varies)

2002-02-07 Thread Scott Fletcher

Hi!

Have anyone ever have problem with the connection speed using PHP and
DB2?  I'm a little puzzled by the odbc_connect reaction.  There were very
many people using the DB2 on the website.  The most I can have is from 5 to
10 people.  For some people, they get quick result from the database using
PHP and for some other, it take longer and get the connection timeout saying
Unable to connect to Database!!!.  What's up with that?

Here's the PHP code I use for the odbc_connect to IBM DB2 (database).  Would
include the SQL_CUR_USE_ODBC help?  I read that part on the PHP website
under the odbc_connect.

-- clip here --
   $database = TEST_DB;
   $user = db2inst1;
   $pass = ibmdb2;

   $cid = @odbc_connect($database,$user,$pass) or die(Unable to connect to
Database !!!) ;
   if ($cid == 0)
   {
exit(brbrfont color='red'bUnable to connect to Database
!!!/b/fontbrbr);
   }
-- clip end --

Thanks,
 Scott



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




[PHP] odbc_connect w/connectstring instead of DSN

2001-09-19 Thread Emile Bosch

Is it possible to connect with odbc_connect with an connectstring instead of
an DSN?

Warm regards,
Emile Bosch





-- 
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] Odbc_connect!

2001-01-30 Thread kaab kaoutar

Hi!
i have an oracle Database and i wanted to use odbc functions i tried it but 
it gives me faile to connect, so i tried an access Database that i put in 
dsn system etc
and i still have the same error!
here is the code :


if (($res = Odbc_Connect("WebZine","kaab","kaab")==0))
{
print ("Couldn't connect to database\n");
exit ();
}

echo $res;
$sql  = "Select * subscribe";
if ($res  0)
{
$id = Odbc_Exec($res, $sql);
$row=1 ;
while (Odbc_Fetch_Row($id,$row))
{$emaildb   = Odbc_result($id,3); echo $emaildb;}
Odbc_Close($res) ;
}
Thanks
_
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


-- 
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] Odbc_connect!

2001-01-30 Thread Brian Clark


Hello kaab, 

(kk == "kaab kaoutar") [EMAIL PROTECTED] told:

kk if (($res = Odbc_Connect("WebZine","kaab","kaab")==0))

Just a wild guess, you might want:

if (($res = Odbc_Connect("WebZine","kaab","kaab")) == 0)

kk {
kk print ("Couldn't connect to database\n");
kk exit ();
kk }

-Brian



-- 
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]