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

Tournament Brackets (Double Elimination)?
Is making a double elimination tournament style bracket system capable of being done in php?

Auto fill in input value based on User_ID
Hello,

I'm looking form some input on the following problem.

User loads page ->

Need help with some php code :)
Hey! I'm quite new to this whole thing, so please don't fire me with shait on this one =D

I'm

how to query data from website using VC?
I want to query some datum from a website,so I need a program to read data from a .csv file, and ass

Is it possible to stop reservation creation in PM Order?
Hi All,

Is it possible to stop reservation creation in PM Order?

Thanks in adv

Oracle Connectivity
Hi Every One,

Can we access SAP from oracle database.If it possible then please spec

add text and number image
hi guys ..

ok see i want the user to add their name and pick a number then click get it and i

Email Script does not reach destination
Hey Guys look at this code snippet :
Code:
//read a line from the file

$myFile = "

Selecting an "empty" date formated field
How do you select an "empty" date field? I've tried the few ways I can think.
SQL> select

unserialize help, getting errors
hi all ,
I got a form with 6 fields (2 input and 4 select box), when the page loads one block is

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