Good morning I am having trouble trying to get my html code to connect. Every ti
ID: 379555 • Letter: G
Question
Good morning I am having trouble trying to get my html code to connect. Every time I click on the link I just designed for "add a product" it says the page isn't working. I have listed my code below. Can somebody tell me what I am doing wrong?
(question below)
Task 3.3 Create a page for inserting a new product
Use the example in Task 3.1, create a page name add_product.php that can take the input from HTML form to insert a new product in existing product table.
The list of columns of product table is here, where i have been using for MySQL database for the format.
(my html code what i have inputed )
---------------------------------------------------------------------------------------------
<?php
/**
* Use an HTML form to create a new customer in the
* customer table.
*
*/
if (isset($_POST['submit']))
{
require "./dbconfig.php";
require "./common.php";
try
{
$connection = new PDO($dsn, $username, $password, $options);
$new_product = array(
"P_CODE" => $_POST['p_code'],
"P_DESCRIPT" => $_POST['p_descript'],
"P_INDATE" => $_POST['p_indate'],
"P_QOH" => $_POST['p_qoh'],
"P_MIN" => $_POST['p_min'],
"P_PRICE" => $_POST['p_price'],
"P_DISCOUNT" => $_POST['p_discount']
"V_CODE" => $_POST['v_code']
);
$sql = sprintf(
"INSERT INTO %s (%s) values (%s)",
"product",
implode(", ", array_keys($new_product)),
":" . implode(", :", array_keys($new_product))
);
$statement = $connection->prepare($sql);
$statement->execute($new_product);
}
catch(PDOException $error)
{
echo $sql . "<br>" . $error->getMessage();
}
}
?>
<?php require "templates/header.php"; ?>
<?php
if (isset($_POST['submit']) && $statement)
{ ?>
<blockquote>New product<?php echo $_POST['p_code']; ?> is successfully added.</blockquote>
<?php
} ?>
<h2>Add a product</h2>
<form method="post">
<label for="p_code">Product Code (5 Digits)</label>
<input type="text" name="p_code" id="p_code">
</br>
<label for="p_descript">Product Description</label>
<input type="text" name="p_descript" id="p_descript">
</br>
<label for="p_indate">Product In Date</label>
<input type="text" name="p_indate" id="p_indate">
</br>
<label for="p_qoh">Product QOH</label>
<input type="text" name="p_qoh" id="p_qoh">
</br>
<label for="p_min">Product Min </label>
<input type="text" name="p_min" id="p_min">
</br>
<label for="p_price">Product price (123.45 format)</label>
<input type="text" name="p_price" id="p_price">
</br>
<label for="p_discount">Product discount (123.45 format)</label>
<input type="text" name="p_discount" id="p_discount">
</br>
<label for="v_code">Vendor Code (5 Digits)</label>
<input type="text" name="v_code" id="v_code">
</br>
<input type="submit" name="submit" value="Submit">
</form>
</br>
<a href="index.php">Back to home</a>
</br>
</br>
<?php require "templates/footer.php"; ?>
Server: localhost:3306»Database: Samson Daniel» E] Table: PRODUCT php Admin E Browse B Structure SQL L Search 3EInsert E Export Elmport Privileges 2°perations 2 Triggers Show all I Number of rows: 25 Filter rows: Search this table Options 11QER/31 Power painter, 15 psi., 3-nozzle 2015-11-03 Recent Favorites information_schema P CODE P DESCRIPT P INDATE P QOHP MIN P_PRICE P_DISCOUNT V_CODE 5 109.99 0.00 14.990.05 0.00 0.00 0.00 5 109.92 005 0.05 0.05 25595 21344 21344 23119 23119 24288 24288 25595 21225 performance_schema 13-Q2/P2 7.25-in. pwr. saw blade Samson Daniel 32 18 14-Q1/L3 9.00-in. pwr. saw blade 1546-QQ2 Hrd. cloth, 1/4-in., 2x50 1558-QW1 Hrd. cloth, 1/2-in., 3x50 2232/QTY B&D; igsaw, 12-in. blade 2232/QWE B&D; jigsaw, 8-in. blade 2238/QPD B&D; cordless drill, 1/2-in. 23109-HBClaw hammer 23114-AA Sledge hammer, 12 lb 54778-2T Rat-tail file, 1/8-in. fine 89-WRE-Q Hicut chain saw, 16 in. PVC23DRT PVC pipe, 3.5-in., 8-ft SM-18277 1.25-in. metal screw, 25 SW-23116 2.5-in. wd. screw, 50 WR3/TT3 Steel matting, 4x8'x1/6", .5" mesh 2016-01-17 2015-12-13 2015-11-13 2016-01-15 2016-01-15 2015-12-30 2015-12-24 2016-01-20 2016-01-20 2016-01-02 2015-12-15 2016-02-07 2016-02-20 2016-03-01 2016-02-24 237 100 8.45 New CUSTOMER 12 17.49 839.95 5 43.99 8 EMP EMPLOYEE 5 99.87 5 38.95 INVOICE LINE PRODUCT VENDOP 10 9.95 5 14.40 20 4.99 0.05 0.00 0.05 0.00 0.00 0.00 0.10 8 21344 24288 43 188 172 5 256.99 75 5.87 75 6.99 21225 21231 25595 18 5 119.95Explanation / Answer
The diamond framework identifies demand conditions, factor conditions, related and supporting industries, firm strategy, structure and rivalry.
So the answer is option "a".
Factor conditions are human and physical resources. Demand condition in home market can create competitive advantages. Related and supporting industries can provide cost effective inputs. Firm strategy and rivalry, government and chance are other frameworks.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.