RE: [PHP-WIN] Error Handling Problems

From: Date: Fri, 06 Oct 2000 00:01:41 +0000
Subject: RE: [PHP-WIN] Error Handling Problems
Groups: php.windows 
Request: Send a blank email to php-windows+get-2970@lists.php.net to get a copy of this message
I tried that, but what that does is turns off the reporting but still returns an error (by outputting a blank page). That's the part that frustrates me as I don't get this behavior with MySQL. I'm missing something that's likely in the manual. Thanks again for helping. -Flint -----Original Message----- From: Pablo Vera [mailto:pvz@vercan.com] Sent: Thursday, October 05, 2000 3:50 PM To: Flint Doungchak Cc: 'php-windows@lists.php.net' Subject: Re: [PHP-WIN] Error Handling Problems Flint: You should add the @ character to the next line as follows: @$result = mssql_query($query,$connect); this will turn off error reporting on that particular line and then you can handle the error. For more information check the section: "Error Handling" on the PHP manual. Saludos, Pablo Vera _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Thursday, October 05, 2000, 2:44:02 PM, Flint wrote: FD> Hello, FD> I've recently switched over to SQL Server from MySQL. I have an error FD> handling problem. Normally, when my result set returns null, I can print an FD> error message or whatever. For instance: FD> $query = "INSERT INTO team_question (team,question) FD> select $teamid as team, question.id from question where question.quest = FD> $questid and active = 1"; FD> $result = mssql_query($query,$connect); FD> if (!$result) fError("S002",$PATH_INFO,""); FD> If the query fails for whatever reason, I could do something via my if FD> statement. However, right now, if the query fails, the script dies and FD> prints error messages. I don't want that. Can someone help me with what I FD> know is a simple problem. FD> Thanks, FD> -Flint FD> _________________________________________________ FD> Flint Doungchak, President FD> Net Solutions, LLC FD> 840 Lawrence Street FD> Eugene, OR 97401 FD> flint@netsolutionsllc.com FD> Voice +1 541 345-7087 FD> Fax +1 541 485-5519 FD> http://www.netsolutionsllc.com

« previous php.windows (#2970) next »