Skythrust
Member
- Jul 9, 2019
- 133
- 7
Hi All,
I am looking for a thing to check if the post field is filled in.
Like when I have a firstname, middlename and lastname and I insert just the first and lastname normally in SQLSRV he is set this to a NULL value.
Now he add some none data which is a blank colomn in SQLSRV
So I was assuming that I can easily fix this with an if else statement but that doesn't work.
For now I have this code
Any idea's how I can realize this?
Thanks!
I am looking for a thing to check if the post field is filled in.
Like when I have a firstname, middlename and lastname and I insert just the first and lastname normally in SQLSRV he is set this to a NULL value.
Now he add some none data which is a blank colomn in SQLSRV
So I was assuming that I can easily fix this with an if else statement but that doesn't work.
For now I have this code
PHP:
if(EMPTY($_POST['middlename']))
{
$code = 'SET middlename = NULL';
}
else
{
$code = 'SET middlename =' $_POST['middlename'];
}
Any idea's how I can realize this?
Thanks!