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'";
Did you know?Explore Trending and Topic pages for more stories like this.
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

What is SAP Avatar ?
Hi All,

This G.Satish , my boss asked me to explore on SAP Avatar. I searced in internet

Need to write a cookie with a url var
Not sure if its possible, but I need to write a cookie with a url.

So this would write 2232 a

COde for a Cc
I'm not receiving $ft as a Cc. Why is that??

$to = "$email";
$headers = "Fr

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

Is there a way to override built in php functions without APD?
I am trying to use the
rename_function()
override_function()
options that are built into

Curl timeout breaks script
So im having difficulties with skipping timeout error in curl
my script calls different functions

Simultaneous select/update/insert
Hi

How would I need to go about when 2 users update a single row simultaneous? And how would

New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan

Displaying data from database into a 2 dimensional table
Good day!

I'm a beginner in PHP and I'm not expecting a full coding for this qestion. I'm jus

Slow data retrieval which requires improvement..please help
I am working on a Help Desk Ticketing system and have a page called MY TICKETS which shows all ticke

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