note 121131 deleted from mysqli-result.fetch-row by peehaa
| From: | peehaa@php.net | Date: | Tue, 06 Jun 2017 10:02:06 +0000 |
| Subject: | note 121131 deleted from mysqli-result.fetch-row by peehaa | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-209122@lists.php.net to get a copy of this message | ||
Note Submitter: zedx at live dot com
----
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Example</title>
</head>
<body>
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
$spend = x;
$dbConn = mysqli_connect("$servername", "$username", "$password",
"$dbname");
if (!$dbConn){
die('Could not connect: ' . mysqli_connect_error($dbConn));
}
$sql = "select * from customer";
$rs = mysqli_query($dbConn, $sql)
or die ('Problem with query' . mysqli_error($dbConn));
?>
<p>Services less than $<?php echo $spend?>:</p>
<table border="1">
<tr><td>Name</td><td>Description</td><td>Price</td><td>Serv
Type</td></tr>
<?php while ($row = mysqli_fetch_array($rs)) { ?>
<tr>
<td><?php echo $row["customerID"]?></td>
<td><?php echo $row["firstName"]?></td>
<td><?php echo $row["state"]?></td>
<td><?php echo $row["postcode"]?></td>
</tr>
<?php } ?>
</table>
<?php mysqli_close($dbConn); ?>
</body>
</html>