Home
Clients Located in California (CA)
| 27 |
Daly Autobody |
4388 Folsom Street |
Suite 673 |
Santa Clara |
CA |
95050 |
(642) 915-9286 |
| 25 |
Easter Travel |
4114 W. Elm |
Suite 370 |
Stratham |
CA |
03885 |
(330) 871-5564 |
| 2 |
Lavaysse Circus |
27 Woodland Avenue |
|
San Mateo |
CA |
94402 |
(211) 107-2844 |
| 26 |
Richman Buick |
PO BOX 4971 |
|
Boulder |
CA |
80302 |
(131) 664-3716 |
| 21 |
Sherwood Oaks |
1941 aberdeen way |
|
Davis |
CA |
95616 |
(143) 275-2569 |
Code follows
<?php
error_reporting(E_ALL);
include('includes/open-db.php');
$query = "SELECT * FROM clients WHERE state = 'CA' ORDER BY name";
$result = mysqli_query($con, $query)
or die("Could not get data: $query " . mysqli_error($con));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Show all Clients located in CA</title>
<link rel="stylesheet" href="../css/styles.css">
</head>
<body>
<div class="page">
<p class="nav"><a href="../../index.php">Home</a></p>
<h1>Clients Located in California (CA)</h1>
<table class="full">
<tr>
<th colspan="8" class="header1">CALIFORNIA CLIENTS</th>
</tr>
<tr class="header2">
<th>ID</th>
<th>Name</th>
<th>Address 1</th>
<th>Address 2</th>
<th>City</th>
<th>State</th>
<th>Zip</th>
<th>Phone</th>
</tr>
<?php
if (mysqli_num_rows($result) > 0) {
$i = 0;
while ($row = mysqli_fetch_array($result)) {
?>
<tr class="row<?php echo($i++ & 1); ?>">
<td><?php echo($row['id']); ?></td>
<td><?php echo($row['name']); ?></td>
<td><?php echo($row['address_1']); ?></td>
<td><?php echo($row['address_2']); ?></td>
<td><?php echo($row['city']); ?></td>
<td><?php echo($row['state']); ?></td>
<td><?php echo($row['zip']); ?></td>
<td><?php echo($row['phone']); ?></td>
</tr>
<?php
}
} else {
echo('<tr><td colspan="8" class="red center">NO CLIENTS FOUND IN CA!</td></tr>');
}
include('includes/close-db.php');
?>
</table>
<hr>
<h2>Code follows</h2>
<div class="code"><?php highlight_file(__FILE__); ?></div>
<p class="nav nav-foot"><a href="../../index.php">Home</a></p>
</div>
</body>
</html>