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

Using two $_POST Function / Switch () statements, second does not work.
Hi all. I’m new to php and am having a problem getting $_POST Function / switch () to work. I

Sql and php order list script problems
Hi im having a few problems with trying to get the coding right on a orders list ive done (or trying

returning data from an ssh2_exec()
here's what i got.


$conn = ssh2_connect($this->_host);
ssh2_auth_password($c

check how many commas the variable containing the query has between [i]select[/i
Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
T

Php - mysql select?
hi, i have this code:

Code: <?php
session_start();
// dBase file
include &quo

scandir clients directory
hi,
how can i scandir the clients directory? i need a script that when i click a button it will u

writing my own sobel filter convolution - something is wrong
I am trying to keep it very simple, I cant see anything wrong with my logic, could anybody help poin

Good Programming and Web Design Books
Hi,

I recived a pm today from a fellow phpfreaker regarding php books, i replied with the fo

fwrite error
Hi All,
Does anyone know what is causing the error in this code?

Code: <?
$error

Take info from one coloum and move to another
Hi all,

I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_

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