If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > Why '@' ?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-01-04, 07:11
rajesh_r_r rajesh_r_r is offline
Registered User
 
Join Date: Jan 2004
Location: India
Posts: 168
Why '@' ?

Hi all
This would be quiet simple for all.. but I don't know why @ is used before some functions like
@session_start()
@print()

why this is used though the out put is same..

Regards
Rajesh
__________________
Freelance and Technology Consultant
-------------------
Dreams are for ever
-------------------
Reply With Quote
  #2 (permalink)  
Old 12-01-04, 19:03
joeldixon66 joeldixon66 is offline
Registered User
 
Join Date: Jul 2003
Posts: 73
When you use a @ character - the errors that are returned are surpressed.

I use it when calling a DB query. For example:
Code:
$result = @mysql_query($query);
If I didn't have the @ before the function, and the query failed, the error would be echo'd to the output (depending on php.ini options). I can still get the error my calling mysql_error() or something simliar.
__________________
Joel Dixon
Analyst Programmer
Melbourne, Australia
Reply With Quote
  #3 (permalink)  
Old 12-02-04, 00:38
rajesh_r_r rajesh_r_r is offline
Registered User
 
Join Date: Jan 2004
Location: India
Posts: 168
Thank you very much
__________________
Freelance and Technology Consultant
-------------------
Dreams are for ever
-------------------
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On