We help IT Professionals succeed at work.
Get Started

user choice test

asaidi
asaidi asked
on
527 Views
Last Modified: 2012-08-16
Hi
is there something wrong with these test as it takes only the last test
if(!empty($_POST[$netw]) && !empty($_POST[$client])){
         include('full.php');  
         p5($date,$date2,$report,$client=$client,$netw=$netw);
        
   
}

elseif (empty($netw) && !empty($_POST['client'])){
  
         include('full.php');  
         p5($date,$date2,$report,$client=$client,NULL);
        
   

}
elseif (empty($client) && !empty($netw)){
 
   
         include('full.php');  
         p5($date,$date2,$report,NULL,$netw=$netw);
         
   
}
elseif (empty($netw) && empty($client)){
   
  
      include('full.php');  
        p5($date,$date2,$report,null,null);
        
  }

Open in new window

if i choose any of parameters it takes when the two are empties

the calling program
function p5($v1,$v2,$v3,$v4,$v5){  
$auto=$_GET['auto'];
 
	echo $v1, PHP_EOL;
	echo $v2, PHP_EOL;
	echo $v3, PHP_EOL;
	echo $v4, PHP_EOL;
        echo $v5, PHP_EOL;
     $sql="SELECT *
        from count_transactions  
          WHERE DATE(tran_date) BETWEEN '$v1' AND '$v2' and account_no=$auto AND customer_no='$v4' AND unit_serial='$v5'  
          group by customer_no,unit_serial"; 
          $res = mysql_query($sql) or die("FAIL: $sql<br>" . mysql_error());
         $num = mysql_num_rows($result1);
while($rows = mysql_fetch_array($res)) { 
....

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Fellow
Most Valuable Expert 2017
Commented:
This problem has been solved!
Unlock 1 Answer and 14 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE