i cant make this bullet choices form to work, it doesnt add the "good" "ok" variables to the database. any help greatly appreciated. thanks. derek
here is the code.
Code:
<?php
include("connect1.php");
////////////////////////////////////////
////////////////////////////////////////
/// query db and loop through rows example
$id = $_POST['id'];
$field2 = $_POST['friend'];
$field3 = $_POST['zip'];
$field4 = $_POST['loyalty'];
$field5 = $_POST['courtesy'];
$field6 = $_POST['stability'];
$field7 = $_POST['attitude'];
mysql_query("INSERT INTO friendgrade (friend,zip,loyalty,courtesy , stability, attitude)VALUES('$field2','$field3','$field4','$field5','$field6' , '$field7')");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Update Statement</title>
<style type="text/css">
<!--
.style1 {color: #990000}
.style2 {color: #0066FF}
.style3 {color: #0000CC}
.style4 {color: #993399}
-->
</style>
</head>
<body>
</p>
<p><span class="style2">*If updating a row, please enter the ID of the row you want to update, and enter the data</span><br />
<br />
<span class="style3">*If adding a new row of data , just leave the ID space blank</span><br />
<br />
<span class="style4">*To delete a row of data, click on the id of the row to delete</span><br />
</p>
<form id="form1" name="form1" method="post" action="">
<table width="90%" border="0">
<tr>
<td>ID</td>
<td><input name="id" type="text" id="id" /></td>
</tr>
<tr>
<td>Friend</td>
<td>
<input name="friend" type="text" id="friend" /></td>
</tr>
<tr>
<td width="32%">zip code</td>
<td width="68%">
<input name="zip" type="text" id="zip" />
</td>
</tr>
<tr>
<td>courtesy</td>
<td>
<input type="radio" name="group1" value="very_poor">very poor
<input type="radio" name="group1" value="poor" checked> poor
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent
</td>
</tr>
<input type="radio" name="group1" value="very_poor">very poor
<input type="radio" name="group1" value="poor" checked> poor
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent
</td>
</tr>
<tr>
<td>stability</td>
<td><input type="radio" name="group1" value="very_poor">very poor
<input type="radio" name="group1" value="poor" checked> poor
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
</tr>
<tr>
<td>loyalty</td>
<td><input type="radio" name="group1" value="very_poor">very poor
<input type="radio" name="group1" value="poor" checked> poor
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
</tr>
<tr>
<td>attitude</td>
<td><input type="radio" name="group1" value="very_poor">very poor
<input type="radio" name="group1" value="poor" checked> poor
<input type="radio" name="group1" value="ok"> ok
<input type="radio" name="group1" value="good"> good
<input type="radio" name="group1" value="excellent"> excellent</td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
Last edited by silverglade; 01-17-2010 at 07:01 AM..
|