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)

228 Like 38 Dislike
Previous php-forum Next php-forum
Other php-forum

How could I do this?
Ive got a simple lottery game, and am using an sql database to keep track of the numbers bought. But

Date Format
Hi there,

I have a date format like this right now:
Sat, 17 Oct 2009 17:04:00

I ne

Why do I get this error?
Error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or

Download Image from URL and Upload it
Ok, I have been googling for the last 1/2 hour trying to figure this out, Most likely I'm just not s

Save cookie to DB
I'm working on a pixel tracking script for an incentive website and I need to use an ASP script to s

Get last modified date of web page
Hai All,

In php how can i get last modified date of a give web page . I have tried to g

Help with simple query
Hi,

I'm trying to do a Query with a Union where I want to print the number of rows $tc conta

passing an array of objects after submit
How do I do this? This is what I have tried and it is not working.

<form method="

News script
Hi ...

I am not sure if this is the rite place to post this but if its not sorry

i am

Posting to another Site?
I have software that people install.
When they install it, is there a way to make it post their d

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