<!DOCTYPE html>
<html lang="en">
	<head>
		<link rel="stylesheet" type="text/css" href="css/bootstrap.css">
		<meta charset="UTF-8" name="viewport" content="width=device-width, initial-scale=1"/>
	</head>
<body>
	<nav class="navbar navbar-default">
		<div class="container-fluid">
			<a href="https://sourcecodester.com" class="navbar-brand">Sourcecodester</a>
		</div>
	</nav>
	<div class="col-md-3"></div>
	<div class="col-md-6 well">
		<h3 class="text-primary">PHP - Insert Array Data Into Database Using PDO</h3>
		<hr style="border-top:1px dotted #ccc;" />
		<div class="col-md-6">
			<table class="table table-bordered">
				<thead class="alert-info">
					<tr>
						<th>Firstname</th>
						<th>Lastname</th>
						<th>Address</th>
					</tr>
				</thead>
				<tbody>
					<?php
						require'conn.php';
						$query = $conn->prepare("SELECT * FROM `member`");
						$query->execute();
						while($row = $query->fetch()){
							echo "<tr>
								<td>".$row['firstname']."</td>
								<td>".$row['lastname']."</td>
								<td>".$row['address']."</td>
							</tr>";
						}
					?>
				</tbody>
			</table>
		</div>
		<div class="col-md-1"></div>
		<div class="col-md-5">
			<form method="POST" action="import.php">
				<button class="btn btn-primary" name="import"><span class="glyphicon glyphicon-import"></span> Import</button>
			</form>
			<br /><br />
			<?php
				$array=array(
					array("firstname"=>"John", "lastname"=>"Smith", "address"=>"New York"),
					array("firstname"=>"Claire", "lastname"=>"Temple", "address"=>"Racoon City"),
				);
				
				echo"<pre>";
				print_r($array);
				echo"</pre>"
			?>
			
		</div>
</body>
</html>