0

id like to input a parameter using an input box it suppose fill a column of an existing table

the submit button need to clear the old values in this column and than fill it with the new values


for example three column row; id, countries, parameter1
on submit clear column parameter and fill with parameter input as many countries as there are

3
Contributors
4
Replies
6
Views
6 Years
Discussion Span
Last Post by sainigks
0

sorry for being unclear.


i imagine a input box, entering the value and pressing the submit button will send this value into a mysql table filling a defined column

mysql table
column1 column2
a cat
b cat
c cat
d cat

enter value "dog" submit on html page

table now looks lik this
column1 column2
a dog
b dog
c dog
d dog


hope this i more clear

0
if(isset($_POST['submit'])){
mysql_query("delete from table_name");
mysql_query("insert into table_name (column1,column2) values ('value1','value2')")or die(mysql_error());
}
0

Hi

yes you can use update query to change the values in column2.

update query will change the data in column2.

Gajendra

This topic has been dead for over six months. 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.