Database Storage & Design Appendix N All Sections The Access Workbench Table Data Whilerecordsetrow Odbcfetcharrayrecordset Echo Lttrgt Echo

subject Type Homework Help
subject Pages 9
subject Words 576
subject Authors David Auer, David M. Kroenke, Robert Yoder, Scott L. Vandenberg

Unlock document.

This document is partially blurred.
Unlock all pages and 1 million more documents.
Get Access
page-pf1
All Sections The Access Workbench
// Table data
while($RecordSetRow = odbc_fetch_array($RecordSet))
// Close connection
odbc_close($Conn);
?>
<br />
AW.7.4. Using the WMCRM database, code a PHP Web page to display the data in
VEHICLE. Add a hyperlink on the WM Web page to access the page. Using your
database, demonstrate that your page works.
page-pf2
All Sections The Access Workbench
<!DOCTYPE html>
<html>
<head>
<?php
// Get connection
$Conn = odbc_connect('WM', '', '');
?>
<!-- Page Headers -->
<h1>
The Wallingford Motors CRM VEHICLE Table
</h1>
<hr />
<h2>
VEHICLE
</h2>
<?php
page-pf3
All Sections The Access Workbench
// Table data
while($RecordSetRow = odbc_fetch_array($RecordSet))
// Close connection
odbc_close($Conn);
?>
<br />
AW.7.5. Using the WMCRM database, create a view named viewSalespersonVehicle and
include in it all the columns in both the SALESPERSON and VEHICLE tables. Code
a PHP Web page to display viewSalespersonVehicle. Add a hyperlink on the WM
Web page to access the page. Using your database, demonstrate that your page
works.
page-pf4
All Sections The Access Workbench
<!DOCTYPE html>
<html>
</head>
<body>
<?php
// Get connection
$Conn = odbc_connect('WM', '', '');
// Test connection
if (!$Conn)
{
exit ("ODBC Connection Failed: " . $Conn);
// Test existence of recordset
if (!$RecordSet)
{
exit ("SQL Statement Error: " . $SQL);
}
?>
<!-- Page Headers -->
<h1>
The Wallingford Motors CRM Salesperson Vehicle List
</h1>
<hr />
<h2>
viewSalespersonVehicle
</h2>
<?php
// Table headers
echo "<table class='output' border='1'>
</tr>";
page-pf5
All Sections The Access Workbench
// Table data
while($RecordSetRow = odbc_fetch_array($RecordSet))
{
echo "<tr>";
}
echo "</table>";
// Close connection
odbc_close($Conn);
?>
<br />
AW.7.6. Using the WMCRM database, code two HTML/PHP pages to add a new
CUSTOMER to the WMCRM database. Create data for two new CUSTOMERs and
add them to the database to demonstrate that your pages work.
New Customer Data:
David.Smith@somewhere.com Smith David 970-654-9876 970-996-9987
Susan.Wu@somewhere.com Wu Susan 404-653-3465 [No Fax Number]
page-pf6
All Sections The Access Workbench
In this solution, we are not including how to take phone number data and store it in the
PHONE_NUMBER table. An extension to the question would be to have the WMCRM
New Customer Form also enter phone number data, and then store it in the
PHONE_NUMBER table (It is relatively easy to do). If you are going to have you students
do this, start with the solution without the phone numbers, and the revise those Web
pages to handle the phone numbers.
NewCustomerForm.html HTML Code:
<!DOCTYPE html>
<html>
<head>
page-pf7
All Sections The Access Workbench
© 2018 Pearson Education, Inc. Page 87 of 102
<body>
<form action="InsertNewCustomer.php" method="POST">
<!-- Page Headers -->
<h1>
WMCRM New Customer Form
</h1>
<hr />
<br />
<p>
<b>Enter Customer Name, Phone Number, Fax Number and Email Address:</b>
</p>
<table>
<p>
<b>Enter Customer Street Address, City, State and ZIP Code:</b>
</p>
<table>
<td>
<input type="text" name="State" size="2" />
</td>
</tr>
<tr>
<td>&nbsp;ZIP Code:&nbsp;&nbsp;</td>
<td>
<input type="text" name="ZIP" size="10" />
</td>
</tr>
</table>
page-pf8
All Sections The Access Workbench
<p>
<b>Select Salesperson Name:</b>
</p>
</select>
<br />
<hr />
</a>
</p>
<hr />
</body>
</html>
page-pf9
All Sections The Access Workbench
InsertNewCustomer.php PHP/HTML Code:
<!DOCTYPE html>
<html>
<head>
</style>
</head>
<body>
<?php
// Get connection
$Conn = odbc_connect('WM', '', '');
// Test connection
if (!$Conn)
{
exit ("ODBC Connection Failed: " . $Conn);
}
// Create short variable names
// Create SQL statement to INSERT new data
$SQLINSERT = "INSERT INTO CUSTOMER ";
// Execute SQL statement
$Result = odbc_exec($Conn, $SQLINSERT);
// Test existence of result
echo "<h1>
page-pfa
All Sections The Access Workbench
if ($Result){
echo "<h2>
New Customer Added:
</h2>
<table>
<tr>";
echo "<tr>";
echo "<td>State:</td>";
echo "<td>" . $State . "</td>";
echo "</tr>";
echo "<td>ZIP:</td>";
echo "<td>" . $ZIP . "</td>";
echo "</tr>";
}
else {
exit ("SQL Statement Error: " . $SQL);
}
{
exit ("SQL Statement Error: " . $SQL);
}
?>
page-pfb
All Sections The Access Workbench
<!-- Page Headers -->
<h2>
CUSTOMER
</h2>
// Table data
while($RecordSetRow = odbc_fetch_array($RecordSet))
echo "</table>";
?>
<br />

Trusted by Thousands of
Students

Here are what students say about us.

Copyright ©2022 All rights reserved. | CoursePaper is not sponsored or endorsed by any college or university.