Populating a form with data from a database

Populating a form with data from a database

am 11.01.2008 23:42:54 von melih.onvural

I am trying to create an edit function. It will grab the data which
already exists from the item being edited, fill the appropriate text
fields/drop downs/etc. and then allow the user to change the values
and resubmit. I don't know how to set the value of form fields from
PHP. Is this possible? Could someone please link me an example, or
give me an idea of how this can be accomplished? Thanks,

--
Melih

Re: Populating a form with data from a database

am 12.01.2008 00:18:31 von luiheidsgoeroe

On Fri, 11 Jan 2008 23:42:54 +0100, Melih Onveral
wrote:

> I am trying to create an edit function. It will grab the data which
> already exists from the item being edited, fill the appropriate text
> fields/drop downs/etc. and then allow the user to change the values
> and resubmit. I don't know how to set the value of form fields from
> PHP. Is this possible? Could someone please link me an example, or
> give me an idea of how this can be accomplished? Thanks,

This would be basic tutorial stuff (usually the existing data is in a
database). Google for PHP + MySQL + form + tutorial, and you'll find
plenty of reading material. Even if the existing data doesn't come from a
database you can use the examples they give you by just substituting the
calls to the database to use your own logic of retrieving/saving.
--
Rik Wasmus

Re: Populating a form with data from a database

am 12.01.2008 00:28:59 von melih.onvural

On Jan 11, 3:18=A0pm, "Rik Wasmus" wrote:
> On Fri, 11 Jan 2008 23:42:54 +0100, Melih Onveral =A0
>
> wrote:
> > I am trying to create an edit function. It will grab the data which
> > already exists from the item being edited, fill the appropriate text
> > fields/drop downs/etc. and then allow the user to change the values
> > and resubmit. I don't know how to set the value of form fields from
> > PHP. Is this possible? Could someone please link me an example, or
> > give me an idea of how this can be accomplished? Thanks,
>
> This would be basic tutorial stuff (usually the existing data is in a =A0
> database). Google for PHP + MySQL + form + tutorial, and you'll find =A0
> plenty of reading material. Even if the existing data doesn't come from a =
=A0
> database you can use the examples they give you by just substituting the =
=A0
> calls to the database to use your own logic of retrieving/saving.
> --
> Rik Wasmus

I figured that was the case, but I guess I need to improve my Google
search ability. Thanks.

--
Melih

Re: Populating a form with data from a database

am 12.01.2008 05:31:38 von thyb0

Melih Onveral wrote:
> On Jan 11, 3:18 pm, "Rik Wasmus" wrote:
>> On Fri, 11 Jan 2008 23:42:54 +0100, Melih Onveral
>>
>> wrote:
>>> I am trying to create an edit function. It will grab the data which
>>> already exists from the item being edited, fill the appropriate text
>>> fields/drop downs/etc. and then allow the user to change the values
>>> and resubmit. I don't know how to set the value of form fields from
>>> PHP. Is this possible? Could someone please link me an example, or
>>> give me an idea of how this can be accomplished? Thanks,
>> This would be basic tutorial stuff (usually the existing data is in a
>> database). Google for PHP + MySQL + form + tutorial, and you'll find
>> plenty of reading material. Even if the existing data doesn't come from a
>> database you can use the examples they give you by just substituting the
>> calls to the database to use your own logic of retrieving/saving.
>> --
>> Rik Wasmus
>
> I figured that was the case, but I guess I need to improve my Google
> search ability. Thanks.
>
> --
> Melih

Well it's pretty simple, just get the data you need from the db and put
them into some 'value' HTML attributes (for most input tags).

Like:

[sql-query]
?>
[..]



[..]

[..]

About the drop downs, you'll probably have to do some loops; just post
more info if you need more help; or yep, Google may get you nice info.

-thibĀ“