0

hi i have made a html page in which i have a drop down list whose code is

<p>Please select the product you want to add 
              <label>
              <select name="menu1" onchange="MM_jumpMenu('parent',this,0)">
                <option>Nylon Blisters</option>
                <option>PP plastic</option>
                            </select>
              </label>
</p>

Now my main aim is that when a certain product is added and we enter it quantity its respective row in database is updated but i dont know how to get its value from form. so that i can update it

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by sidra 100
0

Firstly because you are using a form.. Make sure you declare your using one:

<p>Please select the product you want to add 
<form method="post" action="test.php">
              <label>
              <select name="menu1" onchange="MM_jumpMenu('parent',this,0)">
                <option>Nylon Blisters</option>
                <option>PP plastic</option>
                            </select>
              </label>
              <input type="submit" name="submit" value="Update">
</p>

This code will just display the results of the form input.. But you can use '$name' to update your database:

<?php
	
	$name = $_POST['menu1'];
	
	echo $name;

?>
0

ok i hv tried that. is my this query correct when i want to add certain quanity to already stored quantity i database

$query= "UPDATE rpms SET (quantity=quantity+'$quantity') WHERE product_name='product_name'"
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.