Re: Error Handling Problems
| From: | Pablo Vera | Date: | Thu, 05 Oct 2000 22:49:48 +0000 |
| Subject: | Re: Error Handling Problems | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-2964@lists.php.net to get a copy of this message | ||
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