RE: [PHP-DB] connecting SQL 7.0
Does this DSN test successfully in the ODBC Administrator? If so, try an odbc trace - see what's going on. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 02, 2001 2:32 PM > To: '[EMAIL PROTECTED]' > Subject: RE: [PHP-DB] connecting SQL 7.0 > > > Here is the full script: > > $a=odbc_connect("mydsn","myid","mypwd") or die("Database is down"); > echo "$a"; > $b=odbc_exec($a,"select * from mytable"); > echo odbc_error (); > > FYI, if I execute only the first 2 lines, there is no problem, > meaning that > the server is accesssible ($a is "Resource id #1"). > > When the whole script is executed with Internet Explorer, a > windows pops up > and says: "The connection with the server was reset". > > When executed with Opera, the window says: "Repeated attemps > failed to load > this page completely. Them may be a problem on the server". > > the echo odbc_error() does not help. > > > The Apache server, and php pages are on my PC (localhost) connected to a > LAN, and the SQL Server is on a NT server on the LAN. The dsn odbc driver > is on my PC. > > > What's wrong here and what should I change? > > Thanks to all for your inputs. > > > -Original Message- > From: Andrew Hill [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 02, 2001 2:05 PM > To: LeTortorec, Jean-Louis; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] connecting SQL 7.0 > > > If you attempt to echo out a Resource Id it tells you it's name :) This > should still work in an exec. > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > > -Original Message- > > From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, October 02, 2001 2:10 PM > > To: '[EMAIL PROTECTED]' > > Subject: [PHP-DB] connecting SQL 7.0 > > > > > > $a=odbc_connect("mydsn","myid","mypwd") or die("Database is down"); > > echo "$a"; > > > > > > When I execute this script, I got $a being "Resource id #1". but $a > > should be an integer in order to do a query like > > $b=odbc_exec($a,"select * from mytable"); > > > > > > the dsn I created is a system DSN, as suggested my a member of the > > mailing list. I run PHP4.0 and Apache 1.3 under W2000. > > > > Any suggestion? > > > > Thanks. > > > > > > -- > PHP Database 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 Database 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-DB] connecting SQL 7.0
Here is the full script: $a=odbc_connect("mydsn","myid","mypwd") or die("Database is down"); echo "$a"; $b=odbc_exec($a,"select * from mytable"); echo odbc_error (); FYI, if I execute only the first 2 lines, there is no problem, meaning that the server is accesssible ($a is "Resource id #1"). When the whole script is executed with Internet Explorer, a windows pops up and says: "The connection with the server was reset". When executed with Opera, the window says: "Repeated attemps failed to load this page completely. Them may be a problem on the server". the echo odbc_error() does not help. The Apache server, and php pages are on my PC (localhost) connected to a LAN, and the SQL Server is on a NT server on the LAN. The dsn odbc driver is on my PC. What's wrong here and what should I change? Thanks to all for your inputs. -Original Message- From: Andrew Hill [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 02, 2001 2:05 PM To: LeTortorec, Jean-Louis; [EMAIL PROTECTED] Subject: RE: [PHP-DB] connecting SQL 7.0 If you attempt to echo out a Resource Id it tells you it's name :) This should still work in an exec. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 02, 2001 2:10 PM > To: '[EMAIL PROTECTED]' > Subject: [PHP-DB] connecting SQL 7.0 > > > $a=odbc_connect("mydsn","myid","mypwd") or die("Database is down"); > echo "$a"; > > > When I execute this script, I got $a being "Resource id #1". but $a > should be an integer in order to do a query like > $b=odbc_exec($a,"select * from mytable"); > > > the dsn I created is a system DSN, as suggested my a member of the > mailing list. I run PHP4.0 and Apache 1.3 under W2000. > > Any suggestion? > > Thanks. > > -- PHP Database 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-DB] connecting SQL 7.0
If you attempt to echo out a Resource Id it tells you it's name :) This should still work in an exec. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: LeTortorec, Jean-Louis [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, October 02, 2001 2:10 PM > To: '[EMAIL PROTECTED]' > Subject: [PHP-DB] connecting SQL 7.0 > > > $a=odbc_connect("mydsn","myid","mypwd") or die("Database is down"); > echo "$a"; > > > When I execute this script, I got $a being "Resource id #1". > but $a should be an integer in order to do a query like > $b=odbc_exec($a,"select * from mytable"); > > > the dsn I created is a system DSN, as suggested my a member of the mailing > list. > I run PHP4.0 and Apache 1.3 under W2000. > > Any suggestion? > > Thanks. > > -- PHP Database 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]