I would consider myself to be between the beginner and intermediate levels of PHP programming. I haven't coded in PHP for a year or two now, except for the past two weeks.
I am pulling data from a HTML form... we'll say the field is called "phone", along with fields 1, 2, etc
I want to insert this data into mysql database people table contact.
After the connection info, I have
Code: Select all
$sql="INSERT INTO contact (phone, 1, 2, etc)
VALUES
('$_POST[phone]', '$_POSt[1]', '$_POST[2]', '$_POST[etc]')";What type of if statement would I have php run to verify that the length of a field is > 0, and if it isn't, change '$_POST[field]' to NULL
??
Thanks.