|
Posted by thib΄ on 01/12/08 04:31
Melih Onveral wrote:
> On Jan 11, 3:18 pm, "Rik Wasmus" <luiheidsgoe...@hotmail.com> wrote:
>> On Fri, 11 Jan 2008 23:42:54 +0100, Melih Onveral
>>
>> <melih.onvu...@gmail.com> 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:
<?php
[sql-query]
?>
[..]
<form ..>
<input type="text" name="someformfield" value="<?php echo
$data['somedbfield']; ?>" />
[..]
</form>
[..]
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Β΄
Navigation:
[Reply to this message]
|