View Single Post
Old 07-09-2008, 07:35 PM   #6 (permalink)
sarmenhb
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

this is what i did but it doesnt work can you see what i did wrong?

thanks

Code:
<?php

include("inc/config.php");


for($z=0;$z<=count($name);$z++) {
	for($b=0;$b<=count($quantity); $b++) {
		



$query = mysql_query("insert into tbl_addrow values(null, '$names[$z]','$quan[$b]')");
	}
}

?>


<!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=utf-8" />
<title></title>
<script type="text/javascript" src="inc/addrow1.js"></script>

</head>

<body>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
<table>
<tr><th>Name</th><th>Quantity</th></tr>
<tr class="row_to_clone">
  <td><input type="text" name="name[0]"/></td>
  <td><input type="text" name="quantity[0]"/></td>

</tr>


</table>

<div><input type="submit" /></div>

<div><a onclick="addRow(); return false;" href="#">Add Row</a></div>

</form>



</body>
</html>
__________________
no signature set
sarmenhb is offline  
Reply With Quote