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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.