Multiple if statements


Posted on 16th Feb 2014 07:03 pm by admin

Ok so seems basic but for some reason I'm not doing it right. What I want is to be able to have 2 separate if statements in the same php document. What I've done is this:

Code: if ($p1=='on' AND $p2=='')
$include = " AND points >= '$pointsmin'";
else if ($p1=='' AND $p2=='on')
$include = " AND points <= '$pointsmax'";
else if ($p1=='on' AND $p2=='on')
$include = " AND points BETWEEN '$pointsmin' AND '$pointsmax'";
else if ($p1=='' AND $p2=='')
$include = "";
*/Second if statement/*
if {$k =='on'}
$betweenclause = "x BETWEEN $xLow AND $xHigh AND y BETWEEN $yLow AND $yHigh";
else if {$x=='on' AND $y==''}
$betweenclause = "x BETWEEN $x1 AND $x2";
(The comment in there is not actually in my code so don't worry about it)

No comments posted yet

Your Answer:

Login to answer
228 Like 38 Dislike
Previous forums Next forums
Other forums

Set Categories
I am creating a submission form for somebody to come in and submit products. These products are sep

CRM?
I think that's what they're called. Customer Management System? Anyway. Is there any good free ones

adding 0 to numbers
Hey guys i need to create a 00001 number in a loop. Is there a better way of forcing a 5 digit numbe

Parse Error Help
Hello, I got the parse error "Parse error: syntax error, unexpected ',' in register.php on line

Error in query: Resource id #4??
hey guys, having a minor (i think) problem here that i havent been able to figure out. long story sh

php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]

how to easy edit text, with box? Help.
Hi.
I have a little problem. I'm doing a webpage for my aunt and I would like to make it as easy

max function question
Hi All
Ihave a table that holds shipment numbers and dates like this

select * from

Word Trimming
Hi Guys & Gals!!

Hope you are all ok....

I need some help with the following

Had a simple form script that suddenly stopped working
It was made about a year ago and had been working fine. Last time it was known to work for sure was

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash