pls i badly nid help people!!!

i have to be enable to insert, delete, and update data in one of my php page to my database but its not working but in xampp..it's working..pls help me..
here is my code, i hope you can help me

require("connectionq.php");
?>
<?
$x=mysql_query("select Product_Brand from adapter");
$y=mysql_affected_rows();

echo "<form method=post><select name=prod>";

for($i=0;$i<$y;$i++)
{
$row=mysql_fetch_array($x);
$pnAME=$row['Product_Brand'];

echo "<option value=\"$pnAME\">$pnAME</option>";

}
echo "</select><input type=submit value=search></form>";
?>
<?
$q=mysql_query("Select * from adapter where Product_Brand='{$_POST['prod']}'");
$r=mysql_affected_rows();

for($i=0;$i<$r;$i++)
{
$row=mysql_fetch_array($q);
$id=$row['Product_ID'];
$pn=$row['Product_Brand'];
$pr=$row['Price'];
$st=$row['Stock'];
}
?>

<form method=post>
<table>
<tr>
<td>Product ID:</td>
<td><input type= text value= '<?=$id?>' name=Product_ID></td>
</tr>

<tr>
<td>Product Brand:</td>
<td><input type= text value= '<?=$pn?>' name=Product_Brand></td>
</tr>

<tr>
<td>Price:</td>
<td><input type=text value='<?=$pr?>' name=Price></td>
</tr>

<tr>
<td>Stocks:</td>
<td><input type=text value='<?=$st?>' name=Stock /></td>
</tr>

<tr>
<td><input type=submit value=delete name=del></td>
<td><input type=submit value=update name=upd>
<input type=submit value=Insert name=insert></td>
</tr>
</table>
</form>
<p>
<?
if(isset($_POST['upd']))

{

{if(empty($_POST['Price'])||empty($_POST['Stock']))
{?>
<script type="text/javascript">
alert("PLEASE INSERT A VALUE!");
</script>
<?
}

else if(!is_numeric($_POST['Price'])||!is_numeric($_POST['Stock']))
{?>
<script type="text/javascript">
alert("INVALID VALUE ENTERED!!!");
</script>
<?
}

else
{$upd=mysql_query("UPDATE adapter SET Price='{$_POST['Price']}', Stock='{$_POST['Stock']}' where Product_ID='{$_POST['Product_ID']}' and Product_Brand='{$_POST['Product_Brand']}'");

mysql_query("Insert into adapter values(select * from adapter where Product_ID=$id)");
mysql_query("Delete form adapter where Product_ID=$id");
?>
<script type="text/javascript">
alert("DATA HAS BEEN UPDATED!");
</script>
<?
}}}

if(isset($_POST['del']))
{$del=mysql_query("Delete from adapter where Product_ID='{$_POST['Product_ID']}'");
?>
<script type="text/javascript">
alert("DATA HAS BEEN DELETED!");
</script>
<?
}

if(isset ($_POST['insert']))
{
$id=$_POST['Product_ID'];
$pn=$_POST['Product_Brand'];
$pr=$_POST['Price'];
$st=$_POST['Stock'];

{if(empty($_POST['Product_ID'])||empty($_POST['Product_Brand'])||empty($_POST['Price'])||empty($_POST['Stock']))
{?>
<script type="text/javascript">
alert("PLEASE INSERT A VALUE!!!");
</script>
<?
}

else if(is_numeric($_POST['Product_Brand']))
{?>
<script type="text/javascript">
alert("INVALID PRODUCT BRAND!");
</script>
<?
}

else if(!is_numeric($_POST['Product_ID']) ||!is_numeric($_POST['Price']) ||!is_numeric($_POST['Stock']))
{?>
<script type="text/javascript">
alert("INVALID VALUE ENTERED!");
</script>
<?
}

else
{
$insert = ("Insert into adapter values(" . $id . ",'" . $pn . "'," . $pr . ", " .$st. ")");
mysql_query($insert);?>
<script type="text/javascript">
alert("NEW DATA ADDED!");
</script>

<?
}}
}?>