<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
 <body>
<?php
									global $cxn;
									ini_set('display_errors', '1');
									ini_set('display_startup_errors', 'on'); 
									error_reporting(-1);

									ini_set('error_reporting', 'E_ALL | E_STRICT');
									ini_set('html_errors', 'On');
									ini_set('log_errors', 'On'); 
			require '/home/ethan/PHP/ethan.inc';
			$cxn = mysqli_connect($host,$user,$passwd);
			$db = "Store";
			echo 'hello2';
			
			if (!$cxn) 
			{
	    		die('Connect Error (' . mysqli_connect_errno() . ') '
	            . mysqli_connect_error());
			}
			

									$phn = $_POST['phone'];
									$phn = (string)$phn;
									$dsh = '-';
									$Phn = $phn[0].$phn[1].$phn[2].$dsh.$phn[3].$phn[4].$phn[5].$dsh.$phn[6].$phn[7].$phn[8].$phn[9];
									$sql1 ="select Cust_Num, Lname, Fname from Customers where Phone = '$Phn' ";
									echo $sql1;
									$result1 = mysqli_query($cxn, $sql1);
									echo 'here2';									
									if ( 0 === $result1->num_rows ) 
									{
?>				
										<div align="center">

										<strong>No Match Found</strong>
										<br /><br />
										</div>
<?php
									} 
									$nmbr=mysqli_num_rows ($result1);
									echo '<br />number of rows $nmbr';
									echo 'here3'; //stops at this point
									echo "<br />result.....  $result1";
									print_r($result1);
?>
					 
									<div align="center">
									<table border="4" cellpadding="5" cellspacing="55" rules="all" frame="box">
									<tr class='heading'>
									<th>Customer Number</th>
									<th>Last Name</th>     
									<th>First Name</th>
										
<?php

									while($row1 = mysqli_fetch_row($result1))
									{
										$Cust_Num  = $row1[0];
										$Lname     = $row1[1];
										$Fname     = $row1[2];



?>
										<tr>
										<td> <?php echo $Cust_Num; ?> </td>
										<td> <?php echo $Lname; ?> </td>
										<td> <?php echo $Fname; ?> </td>
										</tr>
<?php                                    
									}
								
?>
              </table>
			</div>		
    </body>
</html>
