Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa PHP Add values of drop down menu( select option) to mysql table

Have Programming Question? Ask it here!
 
 
 


Devika Pathirana
Add values of drop down menu( select option) to mysql table
0 Answer(s)      3 years and 3 months ago
Posted in : PHP


Here is my code

    <?php    
    echo $row['valveName'].'<td>'.$row['valveId'].'<td>';
    echo '<select name="onoff">';
    echo '<option  value="ON">ON';
    echo '</option>';
    echo '<option value="OFF">OFF';
    echo '</option>';
    echo '</select>';
?>
    <tr>
    <td>
    <input type="submit"  name="Submit" align="bottom" border="2" >
    </tr>
<?php
if (isset($_POST['Submit'])) {

    $change=$_POST[onoff];
    echo $change;
}
    /* $selection=$_REQUEST[onoff];
    switch($selection)
    {
    case "1" :
     $change="ON";

    echo $change;
    break;
    case "2" :
    $change="OFF";
    echo $change; 
    }
     */
  $query_auto="UPDATE valve set position='".mysql_real_escape_string($change)."' where valveName='$select1'";
    mysql_query($query_auto) or die(mysql_error());42

but $change has a null value

thanks


Advertisement
View Answers

Related Tutorials/Questions & Answers:
Add values of drop down menu( select option) to mysql table
Add values of drop down menu( select option) to mysql table   Here...['valveId'].'<td>'; echo '<select name="onoff">'; echo '<option value="ON">ON'; echo '</option>'; echo '<option
want to insert values in drop down menu in struts1.3
want to insert values in drop down menu in struts1.3  I am using DynaValidatorForm.please help me with inserting values in color drop down menu. I... <?xml version="1.0" encoding="UTF-8"?> <!-- Document : add
Advertisements
jsp drop down-- select Option
jsp drop down-- select Option  how to get drop down populated...;nbsp;</td> <select name="sel"><option value=""><---Select..."); String buffer="<select name='state'><option value='-1'>Select<
drop down menu
drop down menu  drop down menu using html
Drop down menu
Drop down menu  I have drop down list of some 14 links which links to the table,If i click each link the table should display below the link and again if i click the link the table should not appear. please help me
Drop down menu
Drop down menu  I have created a drop down list of links which links to a table but if i click the link the table display in the other page i want to display it in the same page.Please tell me the solution
JSP Dependent Drop Down Menu
JSP Dependent Drop Down Menu  Hey Guy/Gals! I need someone help to guide me in creating a drop down menu, where the first menu affects the second menu and it's selection. So in my database I have a category table that has a ID
html menu button drop down
html menu button drop down  How to create a menu button in HTML?   <select id="category"> <option value="1">One</option> <option value="2">Two</option> </select> <select id
Get values in drop down list
Get values in drop down list  Pls provide me jsp code to get values in drop down list from another table's field. my project has customer... in drop down box in front end..... pls provide me code.. thanx
jQuery Drop Down Menu
jQuery Drop Down Menu       In this JQuery tutorial we will develop a program  to make Drop Down menu Steps to develop the Drop Down menu . Step 1:         Create
drop down php mysql - PHP
drop down php mysql  PHP Script required to show the similar drop down item in each menu without refreshing the page. Is it possible if yes how
Add/Remove Rows Dynamically with drop down list in html table using php
Add/Remove Rows Dynamically with drop down list in html table using php  Here Is My Code. I want to give and get the id of drop down list. Can Anyone..."); $result=mysql_query("select * from test"); while($row
Pls provide me jsp code to get values in drop down list from another table's field....
Pls provide me jsp code to get values in drop down list from another table's field....  my project has customer registration and company registration... in customer registration page and should be shown in drop down box in front end
store values of drop down list box in database
store values of drop down list box in database  how to store values of drop down list box in oracle database in jsp?I have information inserting form where i have date of birth as drop down list box
Login With Drop Down, Having Departments in different table
to login when I select department from the drop down list. Since I cannot populate the departments name from each table into drop down I use Select tag and declare... is to select the department from the drop down box and then login to the page. I
jQuery Simple Drop Down Menu
jQuery Simple Drop Down Menu In this section, you will learn how to develop a simple drop down menu using jQuery. To develop a drop down menu we put... color="green"> Hover mouse on any menu item to drop down
creation of drop down menu using ajax in java - Ajax
creation of drop down menu using ajax in java  Hi, Here I want to create a drop down menu using ajax in ofbiz framework. I want to fetch the data from database.I got examples using asp.net and php but I am not getting
display table details when selecting table name in drop down liat
display table details when selecting table name in drop down liat  Hello, Am having problem in my project... i want to retrive the data from mysql... of tables from the database to the dropdown list... if i select the particular table
how to retreive data dynamically from mysql to drop down list
how to retreive data dynamically from mysql to drop down list   sir, i created a table in mysql and i inserted some values into the table through... the data of a particular column in a table into drop down list dynamically
Select functionality of drop down list - Struts
Select functionality of drop down list  Hi, I have to write a code(in struts application) in which if user select HIDE from the drop down list... for entering Age,Now if user select "HIDE" from drop-down list the below text
How do i retain values in the drop down - Struts
How do i retain values in the drop down  Hi, I have a jsp page... with the drop down. My problem is whenever i do this the values in the drop down gets reset while the others in the text boxes don't. How do i retain the values
drop down
drop down  how can i add data from choice/dropdown component of java awt to myaql table
how to import values from database to the drop down box
how to import values from database to the drop down box   hi iam... employee page i kept a drop down box for employee Ids i want all employee IDs will display in the drop down box please help me with the code
How to send the data selected from drop down menu from html page to sql 2005 database.
How to send the data selected from drop down menu from html page to sql 2005 database.  Dear Sir, If I want to save the information provided by user from html drop down menu such as check-in date for hotel reservation
how to dynamically add text boxes with add and remove link based on drop down choices, if a particular choice is selected.
how to dynamically add text boxes with add and remove link based on drop down choices, if a particular choice is selected.  how to dynamically add text boxes with add and remove link based on drop down choices, if a particular
mysql alter table add column
mysql alter table add column  Hi, What is the syntax of mysql alter table add column? Thanks   Hi, Here is mysql alter table add column example: ALTER TABLE employee ADD address VARCHAR(50); Read more at MySQL Add
Dynamic Dropdown Menu
records from your database in a drop down menu/list box. You can apply... a table in your desired database,  you can create and insert values using... is open the mysql console and type the following: create table car_list (c_id int
Select from drop down and load the appropriate application resource.properties in struts2
Select from drop down and load the appropriate application resource.properties in struts2  I would like to use a dropdown for selecting a language in my application .On selecting a language the appropriate
Drop Down
Drop Down  How to insert date into database using dropdown like facebook
dynamic drop down
dynamic drop down   I have created 2 drop downs in jsp.1... into the designation drop down (use jsp+javascript+servlet) reply soon   1...; <select onchange="showDesig(this.value)"> <option value="none
How to add another option to the select tag using struts2 tag - Struts
How to add another option to the select tag using struts2 tag  Hi, How to add another option to select tag using tag. My scenario is : If the logged in user is admin then drop down should contain the normal list
Dependent drop down list
Dependent drop down list  hi,i am trying to design a form on which 2 dependent drop down list is used my code is successful but when i select class from first drop down list all the data get lossed means the value entered
Drop Down reload in IE
Drop Down reload in IE  Hi i was using two drop down box..One for Displaying date followed by another for Dispalying Month..If i Select/Change Month from the 2nd drop down then the 1st drop down ( which is date) automatically
Dependant & dynamic drop down list
on the values selected by user in first drop down list. How to achieve this ?   ...`));   This will select only ONE row (country) from first drop down. In my case...Dependant & dynamic drop down list  I don't know this should
Login With Drop Down
a drop down list consisting of Customs and Accounts. I have user accounts of both the departments. Now, my intention is to select the department from the drop down...Login With Drop Down   Hi all, I am doing a project using JSP. My
validation for drop down list
validation for drop down list  Hi all I have a form, it contain 12 drop down list. Each drop down has 1 to 5 values,i need to validate this form. the following condition should be true. 1.you can choose only 3 times 5 value. 2
drop down list in Struts
drop down list in Struts  How to create a drop down list in Struts
how to store multiple values from drop down in database where i am using java struts 1.3
how to store multiple values from drop down in database where i am using java... where i have to select multiple keyskills. but it is taking only one valuee.. i... is displaying.. i need code in java so that it takes multiple values
Ajax drop down and textbox
Ajax drop down and textbox  hie frnds I have a dropdown menu in the 3 options(1,2,3) are there if i choose 1 then I should get 1 text box if i select... menu consisting of options 1,2,3. When the user select any option from
How to display all the Select values from the MySQL database table in where condition= In JSP?
How to display all the Select values from the MySQL database table in where... to display all the select values from MySQL DB** only first value is displayed in the jsp file. @select * from table dept where dept_no=10;" jsp code i have used
Drop down combos
Drop down combos  Hi.. How to write a javascript for linked combo...="combo1" onchange="change(this);"> <option value="0">-Select-</option>... language="javascript"> var arr = new Array(); arr[0] = new Array("-select
dynamic drop down list
dynamic drop down list  I want to create 2 drop down list, where it takes value from database and the two list are dependent..means if I select a particular value from one the other list is developed accordingly..depending
mysql alter table add unique constraint
mysql alter table add unique constraint  How to add mysql alter table add unique constraint in mysql table. Thanks   Hi Following query query can be used: ALTER TABLE mytable ADD CONSTRAINT uc_key1 UNIQUE
Drop down list from database
Drop down list from database  Hi, Can I know how do we get the drop down list from database? Eg: select country--select state--select district--so...; <select name='state' > <option value='-1'><
mysql alter table add multiple columns
mysql alter table add multiple columns  Hi, I have a table in database. I want to add multiple columns into existing table. What is the code for mysql alter table add multiple columns? Thanks   Hi, You can use
alter table add foreign key mysql
alter table add foreign key mysql  Hi, How to add foreign key in mysql using the query 'alter table add foreign key mysql' Thanks   Hi, We can use the following query: ALTER TABLE emp_address ADD FOREIGN KEY (emp_id
Drop Down Box
Drop Down Box  In a Drop Down box I want to show the user All the Country In the World. And when he type A-z,then each of the type Show those country which start with those word. Like I For-India
Mysql Drop
Mysql Drop       Mysql Drop is used to remove or delete the table from the database. Understand with Example The Tutorial illustrate an example from 'Mysql Drop'.To understand
Drop Table
Drop Table       Drop Table in SQL get rid of an object or table from the database. Using a drop Query... from database. The Drop table cannot get it back, once you run the drop Query
mysql select into table from another table example
mysql select into table from another table example  Can you suggest the correct example of select into table from another table example in MySQL... from one table into another table. Check the example at MySQLselect into new
Advertisements
 

 

 

DMCA.com