[Ilugc] FOSS project
manokaran at gmail.com
Sun Feb 15 10:31:59 IST 2009
On Sat, Feb 14, 2009 at 2:53 PM, Shahrukh Khan <shahrukh1514 at gmail.com> wrote:
> Hi to everyone,
> I need help in my project where in a form, if you click a value of a combo
> box then that value should be stored in mysql table. for eg: selecting sex
> (male or female) should be stored along with user details in a single table.
> The table which i created is like this "create table person ( personID int
> NOT NULL AUTO_INCREMENT,PRIMARY KEY(personID),
> FirstName varchar(15), LastName varchar(15), Age varchar(5), DOB
> varchar(20), sex varchar(6) )";
> so except "sex column" all other values are stored as they are input fields
> but for combo value, pls help me to store in that table itself....
I suggest that you use firebug (a firefox plugin). Using this you can
clearly see what parameters the browser sent (to the server) and what
were returned as a response (from the server). This will help you
isolate the problem so you can focus your debugging efforts. If the
combo box value was not even sent to the server then you'll have to
combo box options. If it was sent to the server then the problem is on
the server side.
varchar's take a toll on DB performance. So its advisable to use chars
as much as possible!
'sex' could be a CHAR(1) - M or F. Or maybe CHAR(2) if transgender's
orientation needs to be captured. Age could be an integer (no. of
days!). But when you are storing 'dob' (which should be a 'date' type)
you can always infer the age any time - otherwise you'll have to keep
incrementing the age field every year!
And, be consistent in naming your tables. Am a rails enthusiast and I
like its naming conventions. Perhaps you can use it. Or maybe Django's
More information about the ilugc