Avatar of tf2012
tf2012
 asked on

php queston

I'm saving some text areas to a database and if they are empty I'm ending up with '0' in the field in the DB.

the default value is null for the field (mysql).  How can I format the variable before sending it to the database to not show zero.. can I insert a null value?  

My alternative is to live with the zeros and handle them either in the view php (mvc) or in a jquery script to replace with and empty string.  Seems kind of cheesy to do it that way though.

How can I do this properly in php before I send it to the db?

(FYI it's php within CodeIgniter)
PHPWeb DevelopmentJavaScript

Avatar of undefined
Last Comment
tf2012

8/22/2022 - Mon
SOLUTION
haloexpertsexchange

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
COBOLdinosaur

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Marco Gasi

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Chris Stanyon

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
tf2012

ASKER
I'll post the codeigniter code bits here tomorrow when I'm back on the project thanks for waiting!
tf2012

ASKER
I got it sorted out, thank your  for waiting
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy