Jump to content

[SOLVED] Comments Field


Grant Holmes

Recommended Posts

I have a comments field from a feedback form. In my table it is a "mediumtext" field. I'm using my table for several forms, so on some forms this field is not sent to the db. In that case, I'm getting "NULL" inserted, when I'd prefer it just be blank.

 

Questions:

Did I set up the DB wrong? Should the field be set differently? (NULL: Is set to YES)

Should I just pass an empty quote to the DB with a hidden field?

Does it really matter?

 

Any logic around this would be helpful. I know doing it one way or another could cause more data to be saved in my table than I need. I'd like the smallest possible, no?

Link to comment
https://forums.phpfreaks.com/topic/84310-solved-comments-field/
Share on other sites

I'm not sure which SQL DB editor your using...but as far as I know

there is

 

NULL

and

NOT NULL

 

If you set it to NULL...all that means is if you don't send a value...you'll get a complimentary NULL in place of whatever column you left out of your INSERT statement, or the blank strings...

 

If you set it to NOT NULL....you'll get exactly what you sent to the database...whether you sent it a blank string or not.

Link to comment
https://forums.phpfreaks.com/topic/84310-solved-comments-field/#findComment-429397
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.