Gossamer Forum
Home : General : Perl Programming :

Joining If Commands

Quote Reply
Joining If Commands
Hi All



I have a couple of queries that have the following

if($numrows_domain < 1)
if($numrows_plan < 1)

Which print seperate statements if the value of the queery is 0

What i want to do is to be able to print a single statement if the value of both queries is greater than 0.

How would I go about combining both the above and if either query = 1 or more it prints the statement.

Thanks in advance!
Regards

Mark
http://www.host4.me.uk

No doubt i'll be back for more answers!
Quote Reply
Re: [mdj1] Joining If Commands In reply to
OK,

Im using the following if(($numrows_plan >= 1) || ($numrows_domain >= 1))

and it seems to be working, can someone confirm this is the correct syntax to use?
Regards

Mark
http://www.host4.me.uk

No doubt i'll be back for more answers!
Quote Reply
Re: [mdj1] Joining If Commands In reply to
Yeah, you can use;

if ( ($numrows_plan >= 1) || ($numrows_domain >= 1) ) { }

...or ...

if ( $numrows_plan >= 1 || $numrows_domain >= 1) { }

.. i.e without the () surrounding the 'greater than' statements.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!