RE: [PHP] Things to check before you post (The Ultimate PHP Checlist)
| From: | Lars Wilhelmsen | Date: | Thu, 27 Jul 2000 10:02:19 +0000 |
| Subject: | RE: [PHP] Things to check before you post (The Ultimate PHP Checlist) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-8510@lists.php.net to get a copy of this message | ||
Cool.
I'm about to put one together too: http://zez.org/lw/
--
Lars Wilhelmsen <lw@ez.no>, developer @ eZ systems <www.ez.no>
-----Original Message-----
From: Jeroen Wesbeek [mailto:J.Wesbeek@DoWebWeDo.com]
Sent: 27. juli 2000 11:45
To: 'Lars Wilhelmsen'
Cc: 'Jesper Juhl'
Subject: RE: [PHP] Things to check before you post (The Ultimate PHP
Checlist)
http://php.crash.nu/
;)
Jeroen Wesbeek
Webdeveloper
DoWebWeDo
St. Jacobsstraat 16
3500 AK Utrecht
Netherlands
030-2348110
[ Roses are red, violets are blue, I am schizophrenic and so
am I ]
[ If you don't understand it, get rid of it ]
-----Original Message-----
From: Lars Wilhelmsen [mailto:lw@ez.no]
Sent: donderdag 27 juli 2000 10:43
To: php-general@lists.php.net; php-db@lists.php.net
Subject: [PHP] Things to check before you post (The Ultimate PHP
Checlist)
Hi.
Since the list is beeing flooded with the same questions over and over
again,
some of them about simple syntax errors the poster could have
fixed him/herself instead of writing a mail, I hereby start a new checklist.
(In no particular order - we can edit it later - please contribute):
(and yes - there may be typos in this document too =)
P H P C O D I N G C H E C K L I S T
(Print this out and glue it to your wall)
1. Check the (),[] and {}'s. They should be a pair.
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.
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.
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.]
Regards,
-larsw-
--
Lars Wilhelmsen <lw@ez.no>, developer @ eZ systems <www.ez.no>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net