Hi,
I started my new project with Codeigniter 2 PHP framework and i have struggled with couple of things, cause i can't decide what is best way to create them.
Problem 1
I have form and there is one text input that i can't know advance that how many user needs. So i used jQuery that user can create new inputs onfly. Problem is that, when page gets refreshed, then all user created inputs gets deleted of course. So after i have processed form data, i should someway recreate user made inputs. Question is, what is best way?
Problem 2
Cause we are talking form data what is going to SQL database, and we are talking about one field that i don't know advance how many inputs there will be. What is best way to save unknown amount data to database?
Example: That input could be called "Hobby". User has more than one hobby so he needs more input fields. Should i make "hobby" field to SQL DB and separate different hobby's with comma/space, or should i make own table where all hobby's are as own entry's, and binded to user with ID.
... After i wrote this post, i looked this New Thread form and noticed that there is one solution to my issue. That user don't make new input to every "hobby", but he would separate them to one field with comma or something. But there will be still that database saving question. And still this question is good for my future projects, that how people has managed to do this kind of things.
Regards
No replies to this topic
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account

Back to top









