954,587 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

fill a table with a value

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

johng123
Light Poster
30 posts since May 2011
Reputation Points: 10
Solved Threads: 1
 

Sorry dear ,

i cant understand what you actually want to do. please write all.

sainigks
Light Poster
35 posts since Aug 2010
Reputation Points: 10
Solved Threads: 2
 

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

johng123
Light Poster
30 posts since May 2011
Reputation Points: 10
Solved Threads: 1
 
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());
}
happytogether
Junior Poster in Training
84 posts since Mar 2011
Reputation Points: 16
Solved Threads: 14
 

Hi

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

update query will change the data in column2.

Gajendra

sainigks
Light Poster
35 posts since Aug 2010
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: