mssql_query or ?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

mssql_query or ?

Post by kingconnections »

Ok so I am trying to trap an error, but I do not want the error to be displayed to the user. I am currently doing it like so:

Code: Select all

$result = mssql_query($insert_sql, $dbConn);  
		if (!$result) {
			$error=mssql_get_last_message();
			email_error($insert_sql,"The insert failed for $array[server] with this id: $array[id]<br><br>$error");}
						
}

The problem is that it still displays the error on the screen. I do not want it to exit, I want it to follow the code in the if statement and email me. Any ideas?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

$result = @mssql_query($insert_sql, $dbConn);
see http://www.php.net/language.operators.errorcontrol
kingconnections
Forum Contributor
Posts: 137
Joined: Thu Jul 14, 2005 4:28 pm

Post by kingconnections »

Hey! You Rock!


Thanks!


Dan
Post Reply