I have been trying to clean up the readability of my code and based off a number of answers from here, I have gotten pretty far, however I cannot get my code to work when I try split the HTML from the PHP. The code worked fine when I used the echo statement within PHP code block.I'm trying to output the result of a stored proc to an HTML table outside of PHP block, but still using PHP variables here is my code:
<?php
include_once ('includes/admin.php');
if (isset($_GET['submit'])) {
$id = $_GET['val1'];
}
$wResult = mysqli_query($con, "call getwisherid($id)");
?>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<link href="sqlcss.css" type="text/css" rel="stylesheet">
</head>
<body>
<form>
<input type="text" name="val1" value="" />
<input type="submit" value="submit" name="submit" />
</form>
<?php while($row = mysqli_fetch_array($wResult)){ ?>
<div class="wish_result">
<table>
<tr>
<td><?php echo $row['name'];?></td>
<td><?php echo $row['password'];?></td>
</tr>
</table>
</div>
</body>
</html>