sometime I see pepole use @ with variables
ex:
@$cat=$_GET;

is this something like pass by reference?

can you direct me to a good tutorial in this matter

Thank you

@ help in error handling

How does it help?

Thanks.

@ doesn't help it error handling, but it supresses the errors.

if(@mysql_num_rows($result) > 0){ //do something

This above code, supresses the warning if there is something wrong with the query. Its not a good practice to have @, because it makes your life very difficult to know where the exact error is.

Thanks, Naveen!

. Its not a good practice to have @, because it makes your life very difficult to know where the exact error is.

I agree. I have absolutely never used it.... another lazy practice even worse than short tags.

Good code has error handling, not error suppression.


Matti Ressler
Suomedia

Thank you

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.