Page 1 of 1

mssql_query or ?

Posted: Tue Sep 26, 2006 2:00 pm
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?

Posted: Tue Sep 26, 2006 2:55 pm
by volka

Code: Select all

$result = @mssql_query($insert_sql, $dbConn);
see http://www.php.net/language.operators.errorcontrol

Posted: Tue Sep 26, 2006 3:58 pm
by kingconnections
Hey! You Rock!


Thanks!


Dan