|
Posted by J.O. Aho on 12/14/06 09:27
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.
--
//Aho
Navigation:
[Reply to this message]
|