You are here: Re: mysql_num_rows HELP « All PHP « IT news, forums, messages
Re: mysql_num_rows HELP

Posted by Jerry Stuckle on 04/03/06 19:56

milahu wrote:
> Some hints:
> - You don't need to pass your database connection to mysql_query() (2nd
> argument)
> - When sending queries to your database *always* check for errors using
> sth. like
> mysql_query('...') or die(mysql_error());
> - Use shorter variable names to avoid typing errors
> - Use single quotes ('...') for HTML if you don't like escaping all the
> double quotes too much. ;)
>

No, you don't *need* to pass the database connection. But it's a good idea to
do so. And it never hurts.

If you don't, PHP will use the last opened connection. That may be good now -
but changes in the code at a later date may change that. Now you've added a bug
which can be hard to fix (it fails in an area of code you didn't touch).

Also, I prefer *longer* more descriptive variable names. I don't understand
Dejan's native language, but these variables don't look exactly random to me.
I'm sure they mean something to him.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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