Hi I'm new to php and I'm currently stuck on this question:
Create a PHP page that contains a form that contains an xhtml selection list containing all the customer names (last name is sufficient) as the option text and the customer ID as the value for the option. The selection list must be created by
running an SQL query to obtain the data from the database. The form should have a submit and a rest button. The form should use task8.php as the
action and the method should be get.
what I have so far is as below:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Prac 3 Task 1</title>
</head>
<?PHP
$conn2 = mysql_connect("localhost", "twastudent", "prac3");
mysql_select_db("warehouse", $conn2)
or die ('Database not found ' . mysql_error() );
$sql = mysql_query("SELECT lastName, customerID FROM customer, $conn2)
or die ('Problem with query' . mysql_error());
?>
<body>
<h1>Prac 3 Task 10 </h1>
<form id="task10" action="task8.php" method="get">
</form>
</body>
</html>
where all the information about the name and ID is already stored in a database.
Anyone have any idea where to start or what kind of functions should I use?
|