You are here: Re: I get a syntax error when trying to learn code in a quick start guide. « PHP SQL « IT news, forums, messages
Re: I get a syntax error when trying to learn code in a quick start guide.

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация