Forum Moderators: coopster

Message Too Old, No Replies

textarea fill

         

chumy

1:33 am on Jan 20, 2005 (gmt 0)

10+ Year Member



I need an idea on how to accomplish this task. I have a script that I tried so many times to tweak but failed; so I am starting afresh. I am working on a project with PHP and MySQL and the table below is one of the tables in the db.

title_duty
id int not null auto increment
title varchar(255)
duty text

The table are populated with titles and their duties.
I need a php form with a dropdown menu of the titles of which when a user selects a title, the corresponding duty of the selected title, will display on a text area in the form; where the user can edit the duty. Now the form output can either be submitted to another table for selection with another form or can be a POST in another form. Any ideas on the best way to solve this nagging problem?
Thanks anyone.

s1dev

4:40 am on Jan 20, 2005 (gmt 0)

10+ Year Member



One way is to make it two forms. The first is a form with the dropdown presenting the titles in your table. When this form is submitted, grab the record in the table that matches the chosen title and display the second form with the textarea. When the second form is submitted, save the changed value back to the record.

chumy

1:10 pm on Jan 21, 2005 (gmt 0)

10+ Year Member



I need a php code that can query the db; select and dump the content of the two fields (field1, field2) on the table using the id. I am not that far into php yet but I am looking at examples and learning from there.
So can someone give me a hand please.
Thank you

coopster

4:21 pm on Jan 21, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, chumy.

There is a good starter thread in the PHP Forum Library [webmasterworld.com] that explains the Basics of extracting data from MySQL [webmasterworld.com].