|
Posted by Serge Terryn on 12/14/06 09:35
J.O. Aho schreef:
> Serge Terryn wrote:
>> J.O. Aho schreef:
>>> cerberus wrote:
>>>
>>>> What is the best method for checking the $_POST? In the first if
>>>> statement, or an entirely new if statement. Just curious, I'm a total
>>>> noob.
>>>
>>> if(!empty($_POST['id']) {
>>> /* do what you need to do */
>>> query="...
>>> } else {
>>> echo "damn, id is empty";
>>> }
>>>
>>> http://www.php.net/manual/en/function.empty.php
>>>
>>>
>>
>> with version php4 is the stringvalue 0 (zero) empty !
>>
>> so if(!empty($var) .....
>>
>> wil give false if $var = 0
>
> I doubt that will be a problem in this case, mysql does start auto
> increment from 1 and upward, which would exclude zero values.
>
I know, but in case he will test other $_POST['var'] ....
--
Essetee ---- Roeselare ---- Belgium
http://www.essetee.be
ICQ : 763290 -- Jabber : essetee@jabber.org
[Back to original message]
|