Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How can i add multiple form fields to single database field
  • Dear,

    I would like to add multiple form field to single database field in Fuelphp, Anyway to do so,
  • What do you mean? Can you be more specific?
  • Dear, With example i can explain.

    i have field firstname,middlename,lastname,age,gender.
    i would like to save all of it in databse profile field. there is no firstname,middlename,lastname,age,gender in db, only profile field.
  • Store the different fields in an array after validation, and either serialize() or json_encode() that array before you store the result in the database?
  • Or how about an EAV?
  • That would be a better option, but requires ORM. And in case of ORM, you can use the typing observer to do the serialisation or json encoding for you. But that wasn't the question.

    This suggests the use of Simpleauth, which stores data in a profile field. But on the other hand, for that you don't need to know how to store it, as Auth will take care of that. Ormauth on the other hand uses EAV instead of the profile field.

    So perhaps more info about the context is needed to give a correct answer?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion