the code i'm using is as follows
My Inital form where the user inputs there selection
Code: Select all
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="form1" method="post" action="processorder.php">
<p>
<label> </label>
<br>
<label>
<input type="radio" name="RadioGroup1" value="1125">
Beans
</label>
<br>
<label>
<input type="radio" name="orderlist" value="12">
Tuna Mayo Bagutte</label>
<br>
<label>
<input type="radio" name="orderlist" value="13">
Tuna Salad</label>
<br>
<input type="radio" name="orderlist" value="11">
Special <br>
<input type="text" name="comments">
Comments </p>
<p>
<input type="text" name="quantity">
Quantity </p>
<p>
<input type="text" name="username">
Username</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>Code: Select all
<?php
$item_id=$_POSTї'orderlist'];
$comments=$_POSTї'comments'];
$quantity=$_POSTї'quantity'];
$user_name=$_POSTї'username'];
$hostname="localhost";
$mysql_login="root";
$mysql_password="******";
$database="coachhouse";
$connect = mysql_connect("$hostname", "$mysql_login" , "$mysql_password");
$table_name = emp_order;
$result = mysql_query ("SELECT item_description from item where item_id = '$item_id'",$connect);
$query = ("INSERT INTO emp_order VALUES ('','$result','$quantity','$comments','$user_name')");
mysql_query($query);
mysql_select_db($database);
PRINT '<br><font size ="4" colour="blue">';
IF (mysql_query($query))
PRINT "<center>Order Has Been Placed</Center></font><BR><BR>";
mysql_close($connect);
?>Does anyone maybe have a better solution?
I'm new to php so please dont get too technical with me, lol
regards
Shab