[SOLVED]What does @ means in front of mysql_query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

[SOLVED]What does @ means in front of mysql_query

Post by Calimero »

Had one of these in my scripts - for spliting 100 recirds into 10 pages.

What does this do?
Last edited by Calimero on Tue Oct 05, 2004 8:38 am, edited 1 time in total.
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

Error supression, that's it.
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

...

Post by Calimero »

Me and my english are not sure about the meaning:

is it - preventing of showing errors,
or correcting them ?!?!?!
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

preventing to show them..
:)
Breckenridge
Forum Commoner
Posts: 62
Joined: Thu Sep 09, 2004 11:10 pm
Location: Breckenridge, Colorado

Post by Breckenridge »

It does not fix errors. It simply prevents your script from reporting errors to your browser.
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

...

Post by Calimero »

And how does this exactly help me or someone currently on my site - if the error happens.

Don't see the point of it !?!?
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

It's more a security thing. You don't want to output things in browser that could help someone hack you database, for exemple..
User avatar
Calimero
Forum Contributor
Posts: 310
Joined: Thu Jan 22, 2004 6:54 pm
Location: Milky Way

...

Post by Calimero »

A-ha,

from that point of view...,

Ok.


Thanks for the edu session :) .
Draco_03
Forum Regular
Posts: 577
Joined: Fri Aug 15, 2003 12:25 pm
Location: Montreal, Canada

Post by Draco_03 »

hehe your welcome :)
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

When you use @ whilst developing, don't forget to set some sort of error handling otherwise you could have an irritating time trying to debug funky code, or die() statements are pretty handy, e.g.:

Code: Select all

$result = mysql_query($sql) or die(mysql_error().'<p>'.$sql.'</p>');
Mac
Post Reply