Jump to content

a mysql skip function


PC Nerd

Recommended Posts

hi guys....

 

 

i want to have a function, where i can go something liek:

 

if mysql has error, {

 

mysql_status_enable = 0;

 

}

 

this way, it would cancel all funtions and variables relying on anything to do with the database....... and even replace those values, with something like "ERROR"

 

 

is there a function or a way to do this?

 

 

 

PS

 

im not looking for a simply or die(); statement

 

 

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/51049-a-mysql-skip-function/
Share on other sites

mysql_close closes the connection with MySQL so any future queries will not be able to run because there are no connection details availiable. Alternatively you can do this:

 

<?php

$query = mysql_query("SELECT * FROM table") or $error = true;

/* Future queries... */

if(!$error) {
$query2 = mysql_query("SELECT * FROM table2") or $error = true;
}

?>

Link to comment
https://forums.phpfreaks.com/topic/51049-a-mysql-skip-function/#findComment-251360
Share on other sites

ok, greatm thnks for your help..

 

 

 

is there any other way, to go it gloablly, like an event handeler or something liek:

 

 

on mysqli_error() mysqli_ = 0;

 

to cancel anything using mysqli_.......... if there is an error cauased by =it, and to possibly set it to mute "@" the error?

 

 

cani do it that way? like in my ini file, or .htaccess on my login with my host etc.?

 

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/51049-a-mysql-skip-function/#findComment-251370
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.