Forum Moderators: open

Message Too Old, No Replies

MySQL Table (Basic User)

         

sleepinglion

9:18 am on Apr 19, 2008 (gmt 0)

10+ Year Member



If i had a field where the input was about 20 character of mixed letters, numbers and dashes

...Which field type should I use?

And should someone forget to complete the field in the form

...How could I set default value for that same field to show something other than an empty string?

?

ashish21cool

9:22 am on Apr 19, 2008 (gmt 0)

10+ Year Member



you can make use of varchar (20) datatype.
Instead of showing default value or blank value you should include a required filed validator. This will ensure that the person doesnot forget to enter the field specified.

Hope this will help you.

sleepinglion

9:27 am on Apr 19, 2008 (gmt 0)

10+ Year Member



I already have a lot of required fields was hoping to do this without another one...

is there another way?

sleepinglion

9:43 am on Apr 19, 2008 (gmt 0)

10+ Year Member



It's okay did it in php instead!

ashish21cool

9:51 am on Apr 19, 2008 (gmt 0)

10+ Year Member



you will need to put a condition to check whether the field is empty or not then based on that u can enter the value in db.
For e.g:
if (field is empty)
{
Then insert ur default text
}
else
{
Enter field value
}