Re: Things to check before you post (The Ultimate PHP Checlist)

From: Date: Thu, 27 Jul 2000 11:55:16 +0000
Subject: Re: Things to check before you post (The Ultimate PHP Checlist)
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-8535@lists.php.net to get a copy of this message
Hi Jesper! On Thu, 27 Jul 2000, Jesper Juhl wrote: > > 1. Check the (),[] and {}'s. They should be a pair. [plus a hint] in vi/vim you can use %' to jump to the corresponding )',]',}' so on. in Emacs go to paren' options. (in viper mode, you can also use %' just like in vi) for other editors, check for `paren highlighting' feature. plus, if you get an error with a line beyond the end of file, then you probably missed one of these. > > 2. Check the strings. "" inside a "" string doesn't work > > unless you > use > > \" instead. > > 3a. Check for typos in reserved words. myslq_num_rows() doesn't work. > > mysql_num_rows() does. > > 3b. Use the manual at www.php.net/manual, a local mirror etc, to > check > > your syntax, > > not the mailing-list. > > 4. Remember to include global statements if you want to use global > > variables in a function. also note HTTP_*_VARS are not like GLOBALS and you must use `global' too. > > 5. If you want to set cookies with setCookie() or equal, ensure that > > you have not outputed > > ANY characters. That includes whitespace before your starting > <? > > or <?php too. + the previous add (ob_* stuff) > > 6a. If SQL queries fail, write them out with echo or print, and check > > the syntax. > > Especially if you have included $variables in the statement. > > 6b. If the statement looks all right, try the query with your DB > query > > tool. > > (Like mysql commandline tool). > > 6c. If it still won't work - check if you have granted the db user > the > > right access. > > 7. If your getting "can't redeclare foo()" you've probably > > included > a > > file twice. > > use include_once() to prevent it. > > 8. Remember the case-sensitivity. $Foo may not be the same as $FOO. > > 9. It's $this->foo() and $this->variable. Not $this->$foo() and > > $this->$variable. > > 10. Even if your not an IRC geek, try #php on EFNet, there's always a > > bunch of helpfull guys around. > > > n. [Extend here.] how about a `netiquette' for posting/behaving on the mailing lists? -- teodor

« previous php.general (#8535) next »