Jump to content

[SOLVED] Quick Question about breaking out of a function


pquery

Recommended Posts

Quick Q, because maybe I'm having a little brain fart....

 

I'm building a function that's checking to see if a someone has a record on 20 different tables and will then calculate cumulative totals, but I want it to stop if it doesn't find a record on any of the tables as to save processes.

 

would a break; statement work like used on a switch? ex:

 

if($count1==1){
$total++;

}else {
break;
}

 

I know break can be used to break out of loops but will it break out of the function totally? I'm planning to just have this function included on a variety of different pages.

 

thanks

 

 

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.