This is a website picture The html and css code is as
follow
And my problem is as follow
use the php and mysql
Here is your php file. Mysql query is done using mysqli, because mysql is deprecated, if you want mysql query let me know. If you face any problem comment.
I don't know your desinging pattern so I outputted in clear text with table.
Code
<?php
$submit = $_POST["submit"];
switch ($submit) {
case 'Insert':
insertRecord();
break;
case 'Search':
search();
break;
case 'List All Records':
listAllRecords();
break;
case 'Find':
findById();
break;
case 'List City':
listCity();
break;
default:
echo "Unknown request";
break;
}
function insertRecord(){
$customerName = $_POST["customerName"];
$contactName = $_POST[contactName"];
$address = $_POST["address"];
$city = $_POST["city"];
$postalCode = $_POST["postalCode"];
$country = $_POST["country"];
$sql = "INSERT into Customers(CustomerName, ContactName, Address, City, PostalCode, Country) VALUES('$customerName', '$contactName', '$address', '$city', '$postalCode', '$country');";
$con = getSql();
$con->query($sql);
$insertId = $con->insert_id;
echo "New Record inserted.";
echo "<br>CustomerName: $customerName";
echo "<br>ContactName: $contactName";
echo "<br>Address: $address";
echo "<br>City: $city";
echo "<br>PostalCode: $postalCode";
echo "<br>Country: $country";
$con->close();
}
function search(){
$fieldName = $_POST["fieldName"];
$search = $_POST["search"];
$sql = "SELECT * FROM Customers WHERE $fieldName='$search' ORDER BY CustomerName";
$con = getSql();
$result = $con->query($sql);
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>CustomerName</th>";
echo "<th>ContactName</th>";
echo "<th>Address</th>";
echo "<th>City</th>";
echo "<th>PostalCode</th>";
echo "<th>Country</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo
"<td>$row[CustomerName]</td>";
echo
"<td>$row[ContactName]</td>";
echo
"<td>$row[Address]</td>";
echo
"<td>$row[City]</td>";
echo
"<td>$row[PostalCode]</td>";
echo
"<td>$row[Country]</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
$con->close();
}
function listAllRecords(){
$orderBy = $_POST["radioAll"];
if (empty($orderBy)) {
$orderBy = "asc";
}
$sql = "SELECT * FROM Customers ORDER BY
$orderBy";
$con = getSql();
$result = $con->query($sql);
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>CustomerName</th>";
echo "<th>ContactName</th>";
echo "<th>Address</th>";
echo "<th>City</th>";
echo "<th>PostalCode</th>";
echo "<th>Country</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while ($row = $result->fetch_assoc()) {
echo "<tr>";
echo
"<td>$row[CustomerName]</td>";
echo
"<td>$row[ContactName]</td>";
echo
"<td>$row[Address]</td>";
echo
"<td>$row[City]</td>";
echo
"<td>$row[PostalCode]</td>";
echo
"<td>$row[Country]</td>";
echo "</tr>";
}
echo "</tbody>";
echo "</table>";
$con->close();
}
function findById(){
$id = $_POST["findById"];
$sql = "SELECT * FROM Customers WHERE id=$id LIMIT 1";
$con = getSql();
$result = $con->query($sql);
$row = $result->fetch_assoc();
echo "<table>";
echo "<thead>";
echo "<tr>";
echo "<th>CustomerName</th>";
echo "<th>ContactName</th>";
echo "<th>Address</th>";
echo "<th>City</th>";
echo "<th>PostalCode</th>";
echo "<th>Country</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td>$row[CustomerName]</td>";
echo "<td>$row[ContactName]</td>";
echo "<td>$row[Address]</td>";
echo "<td>$row[City]</td>";
echo "<td>$row[PostalCode]</td>";
echo "<td>$row[Country]</td>";
echo "</tr>";
echo "</tbody>";
echo "</table>";
$con->close();
}
function listCity(){
$city = $_POST["city"];
$sql = "SELECT * FROM Customers WHERE city LIKE '$city'";
$con = getSql();
$result = $con->query($sql);
if ($result==false || $result->num_rows < 1)
{
echo "No Records found.";
}else{
echo "<table>";
echo "<thead>";
echo "<tr>";
echo
"<th>CustomerName</th>";
echo
"<th>ContactName</th>";
echo
"<th>Address</th>";
echo
"<th>City</th>";
echo
"<th>PostalCode</th>";
echo
"<th>Country</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
while ($row =
$result->fetch_assoc()) {
echo
"<tr>";
echo
"<td>$row[CustomerName]</td>";
echo
"<td>$row[ContactName]</td>";
echo
"<td>$row[Address]</td>";
echo
"<td>$row[City]</td>";
echo
"<td>$row[PostalCode]</td>";
echo
"<td>$row[Country]</td>";
echo
"</tr>";
}
echo "</tbody>";
echo "</table>";
}
$con->close();
}
function getSql(){
$con =
mysqli_connect("localhost","username","password","dbname");
return $con;
}
This is a website picture The html and css code is as follow And my problem is as follow use the php and mysql Northwind Customer Database Search List Records All Records CustomerName v CustomerName...
in the following java script code follow the instructions provided <!DOCTYPE html> <html> <head> <!-- JavaScript 6th Edition Chapter 5 Hands-on Project 5-2 Author: Date: Filename: index.htm --> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Hands-on Project 5-2</title> <link rel="stylesheet" href="styles.css" /> <script src="modernizr.custom.05819.js"></script> </head> <body> <header> <h1> Hands-on Project 5-2 </h1> </header> <article> <h2>Change of address form</h2> <form> <fieldset id="contactinfo"> <label for="addrinput"> Street Address </label> <input type="text" id="addrinput" name="Address" /> <label for="cityinput"> City </label> <input type="text" id="cityinput" name="City"...
As part of this assignment we are using the base Gallery HTML and writing JavaScript code that will: 1) preload the images provided to us, 2) Create rollover functionality for each of the thumbnails in your image gallery 3) Use appropriate images found in the images folder. 4) Write developer comments to describe the variables being declared and explain the functions and logical blocks of JavaScript code pertaining to the gallery. I know it has to be an external JS...
Does my css style sheet look okay?
/* Author: Your Name -->
Natasha Strange
/* Date: Today's
Date --> September 22, 2019
/* Description: Lab Number --> Lab04
/*doctype css*/
@import url(fonts/chuckfive.css);
@import url(fonts/merriweather.css);
body { background-color: rgb(199,201,191);
}
div { border: 1px solid black;
padding: 100px 100px 100px
100px;
background-color: gray;
}
nav { text-align: center;
color: rgb( 7,20,138);
}
header,
footer { background-color: rgb(199,201,199);
color:...
Hello, I am designing a website for my class. I am using HTML/CSS/Jscript. I need to have my text in the body, white. All text and the picture centered but how do I have margins on the left and right side?. I have a figcaption and I dont know have to place it under the picture but I am having a hard time. Can you help me? Thank you! HTML <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet"...
the is my HTML and CSS code. I didn't attach the image or the
CSS file because of the space limit.
two things I wanted to incorporate on this page are to make "MY
TOP 3 MUSIC GENRES" blink using javascript and to make the video
links autoplay using javascript
both should be using javascript
requirement: our professor told us not to use <div> or
alert.
thank you for your help
<!DOCTYPE html>
<!-- I used w3school for the formatting...
Hello, this is my code. moest of the things works but when select the price, i just dont get my total. can someone help me out . thank you My queshion is also here The page will simulate the site for a Chicago-based small bus line that travels to St Louis, Milwaukee, and Detroit. Here are the requirements: The home page (i.e. the main page) should simply be the heading, image, and slogan of the site. The home page should NOT...