RE: [PHP-DB] MS SQL 'Changed database context' error
Thanks, Frank. Since I'm getting script stoppage as a result of this error (message), does that suggest that PEAR is mishandling the error/message? (I think PEAR loads and uses the standard mssql extension, but I'm not sure. Even if it does, I don't know if it inserts itself into the error handling stream.) You say that if a message has a severity higher than the setting in php.ini (mine is set to 10), then it will stop the script. Since the message I'm concerned with is a 0, then it should not stop the script. But, my script is stopping as a result of that message. So, is this a PEAR problem? If not, what am I doing wrong? If so, how can I get around this? Thanks! Michael -Original Message- From: Frank M. Kromann [mailto:[EMAIL PROTECTED] Sent: Saturday, February 21, 2004 7:40 PM To: Php-Db Subject: RE: [PHP-DB] MS SQL 'Changed database context' error The MSSQL standard mssql extension handles the 'Changed database context' message correct. Each query send to the SQL server results in some form of message returned. This can be either an error message or an information message. The MSSQL extension uses two ini settings to tell PHP how to handle these messages. If a message from the server has a severity equal to or higher than the setting in php.ini, PHP will create a warning or an error (stop processing the script). The default setting for both parameters is 10, and that should give a smooth execution of most PHP scripts. For debugging you might want to lover these values. (And this is not what I said in an earlier post but I was wrong then. This time I checked it :-)) 'Changed database context' has a severity = 0. This will only be handled by PHP if mssql.min_message_severity = 0. The mssql_get_last_message() function will always return the last message from the server. This function should not be used to check for errors. The function is intended to give the programmer a tool to fetch the message if an error is detected. - Frank > Hi Robert, > > I've seen your name on a few of the ODBTP posts. You're one of the > developers of same, yes? Are you familiar with the 'Changed database > context' message? Do you know for sure that ODBTP handles that correctly? > > Thanks. > > Michael > > -Original Message- > From: Robert Twitty [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 19, 2004 5:38 PM > To: Michael Flanagan > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] MS SQL 'Changed database context' error > > > Hi Michael > > You might get better results using the odbtp extension with support for > the mssql functions. Since you are using Windows, use > php_odbtp_mssql.dll instead of php_mssql.dll. > > -- bob > > On Thu, 19 Feb 2004, Michael Flanagan wrote: > > > Adam, Thanks for the suggestions. I don't want to ignore all error > > handling. Later, I might get an error that I really don't want php to > > swallow due to either of your suggestions. > > > > Has anyone else run into this and solved it? > > > > Any idea why the following lines in the php.ini file don't work? > > mssql.min_error_severity = 11 > > mssql.min_message_severity = 11 > > > > Michael > > > > -Original Message- > > From: Adam Voigt [mailto:[EMAIL PROTECTED] > > Sent: Thursday, February 19, 2004 12:44 PM > > To: Michael Flanagan > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP-DB] MS SQL 'Changed database context' error > > > > > > Try putting the error suppressor (@) before the query, eg: > > > > @mssql_query > > > > Or, try setting the error reporting: > > > > error_reporting(0); > > > > > > > > On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote: > > > Thanks, Adam. > > > > > > I don't get the error in Enterprise manager. MS has a KB article out > that > > > says that this message is informational. I seem to remember that the > > > article also says the message comes out some times, and not other times, > > but > > > that you should just forget it. > > > > > > The particular SELECT statement I'm getting the message on is the second > > > query in my script. The other query is to the same db; in fact, it uses > > the > > > exact same $db connection object. > > > > > > Any ideas on getting PHP to ignore this info message? > > > > > > Thanks again. > > > Michael > > > > > > -Original Message- > > > From: Adam Voigt [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, February 19, 2004 12:13 PM > > > To: Michael Flanagan > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: [PHP-DB] MS SQL 'Changed database context' error > > > > > > > > > This may not be the case, but I've seen this before when the PHP library > > > didn't know how to express MS SQL's error, so it simply returns the last > > > message sent which was the informational context change. If it is infact > > > an error, you should be able to plug the query directly into Enterprise > > > Manager to see MS SQL's take on the problem, so to speak. =) > > > > > > But again, this is all just in my past experience's, yours may differ > >
RE: [PHP-DB] MS SQL 'Changed database context' error
The MSSQL standard mssql extension handles the 'Changed database context' message correct. Each query send to the SQL server results in some form of message returned. This can be either an error message or an information message. The MSSQL extension uses two ini settings to tell PHP how to handle these messages. If a message from the server has a severity equal to or higher than the setting in php.ini, PHP will create a warning or an error (stop processing the script). The default setting for both parameters is 10, and that should give a smooth execution of most PHP scripts. For debugging you might want to lover these values. (And this is not what I said in an earlier post but I was wrong then. This time I checked it :-)) 'Changed database context' has a severity = 0. This will only be handled by PHP if mssql.min_message_severity = 0. The mssql_get_last_message() function will always return the last message from the server. This function should not be used to check for errors. The function is intended to give the programmer a tool to fetch the message if an error is detected. - Frank > Hi Robert, > > I've seen your name on a few of the ODBTP posts. You're one of the > developers of same, yes? Are you familiar with the 'Changed database > context' message? Do you know for sure that ODBTP handles that correctly? > > Thanks. > > Michael > > -Original Message- > From: Robert Twitty [mailto:[EMAIL PROTECTED] > Sent: Thursday, February 19, 2004 5:38 PM > To: Michael Flanagan > Cc: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] MS SQL 'Changed database context' error > > > Hi Michael > > You might get better results using the odbtp extension with support for > the mssql functions. Since you are using Windows, use > php_odbtp_mssql.dll instead of php_mssql.dll. > > -- bob > > On Thu, 19 Feb 2004, Michael Flanagan wrote: > > > Adam, Thanks for the suggestions. I don't want to ignore all error > > handling. Later, I might get an error that I really don't want php to > > swallow due to either of your suggestions. > > > > Has anyone else run into this and solved it? > > > > Any idea why the following lines in the php.ini file don't work? > > mssql.min_error_severity = 11 > > mssql.min_message_severity = 11 > > > > Michael > > > > -Original Message- > > From: Adam Voigt [mailto:[EMAIL PROTECTED] > > Sent: Thursday, February 19, 2004 12:44 PM > > To: Michael Flanagan > > Cc: [EMAIL PROTECTED] > > Subject: RE: [PHP-DB] MS SQL 'Changed database context' error > > > > > > Try putting the error suppressor (@) before the query, eg: > > > > @mssql_query > > > > Or, try setting the error reporting: > > > > error_reporting(0); > > > > > > > > On Thu, 2004-02-19 at 14:38, Michael Flanagan wrote: > > > Thanks, Adam. > > > > > > I don't get the error in Enterprise manager. MS has a KB article out > that > > > says that this message is informational. I seem to remember that the > > > article also says the message comes out some times, and not other times, > > but > > > that you should just forget it. > > > > > > The particular SELECT statement I'm getting the message on is the second > > > query in my script. The other query is to the same db; in fact, it uses > > the > > > exact same $db connection object. > > > > > > Any ideas on getting PHP to ignore this info message? > > > > > > Thanks again. > > > Michael > > > > > > -Original Message- > > > From: Adam Voigt [mailto:[EMAIL PROTECTED] > > > Sent: Thursday, February 19, 2004 12:13 PM > > > To: Michael Flanagan > > > Cc: [EMAIL PROTECTED] > > > Subject: Re: [PHP-DB] MS SQL 'Changed database context' error > > > > > > > > > This may not be the case, but I've seen this before when the PHP library > > > didn't know how to express MS SQL's error, so it simply returns the last > > > message sent which was the informational context change. If it is infact > > > an error, you should be able to plug the query directly into Enterprise > > > Manager to see MS SQL's take on the problem, so to speak. =) > > > > > > But again, this is all just in my past experience's, yours may differ > > > greatly. > > > > > > > > > > > > On Thu, 2004-02-19 at 14:08, Michael Flanagan wrote: > > > > I'm getting the error "Changed database context" from MS SQL. I see > > > > where this is supposedly just an informational message. I've tried > > > > setting > > > > > > > > mssql.min_error_severity = 11 > > > > mssql.min_message_severity = 11 > > > > > > > > but to no avail. What am I missing? I don't mind the message so > much, > > > > but php treats this as an error, and doesn't execute my query. > > > > > > > > I'm running php 4.3.3 for Windows; the SQL Server and web server are > on > > > the > > > > same machine. I'm using PEAR:DB for the database access. > > > > > > > > Thanks. > > > > > > > > Michael Flanagan > > > > voice: (1) 303-674-2691 > > > > fax: (1) 603-963-0704 (note '603' area code) > > > > mailto:[EMAIL PROTECTED] > > > -- > > > > > > Adam
[PHP-DB] Help with SQLite and ADOdb
I'm working on a website whose hosting package doesn't include any db (except maybe gdbm). I've install sqlite in the home directory. The question is what adjustment do I have to make to my PHP script and ADOdb in order for it to exicute SQLite in from the account home direcory? TIA, Davd -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: [PEAR] Re: PEAR DB 1.6.0 has been released
Justin Patrin wrote: I think you're confusing the issue. PEAR DB does support many databases, but it only loads the code for the ones that you are currently using. So if you're using one database it is effectively a one database API. Jakes wrote: What is performance like using this class? I've gone through the class and it just seams to be over kill, for a DB API (13 databases). Are there any time stats showing the different time in using a single DB API class to the PEAR class. Yes things are really not that bad. However expect to give up somewhere a fairly significant amount of performance. If you are using an abstraction layer you have to do it with a good reason (you need to support multiple databases mainly :-) ). Here is a benchmark John Lim came up with: http://phplens.com/lens/adodb/ It only tests MySQL though and it implements a very unrealistic scenario. The reason that ADODB scores so high can be read here: http://marc.theaimsgroup.com/?l=pear-dev&m=100793507904834&w=2 regards, Lukas Smith [EMAIL PROTECTED] ___ BackendMedia www.backendmedia.com [EMAIL PROTECTED] Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php