|
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]
|