Re: EMPTY??
| From: | Nathan Nobbe | Date: | Tue, 23 Oct 2007 18:15:07 +0000 |
| Subject: | Re: EMPTY?? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-263572@lists.php.net to get a copy of this message | ||
On 10/23/07, Dan Shirah <mrsquash2@gmail.com> wrote:
>
> Correct, which is why in my original post I set two variables.
>
> $comments = strtoupper($_POST['comments']); //This is the value I want
> saved
> in my database.
> $check_comments = $_POST['comments']; //This is the value I am using to
> determine if there were any comments entered.
there is no reason to have 2 variables. just have one variable and
initialize it.
$comment = '';
if(!empty($_POST['comment])) {
$comment = strtoupper(trim($_POST['comment']));
}
later you can check $comment using empty($comment)
where is the code w/ the statement about the database ?
-nathan