TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-14-2010, 04:54 PM   #1 (permalink)
The Visitor
 
Join Date: Jun 2010
Posts: 4
Thanks: 1
haskabab is on a distinguished road
Default @ in front of mysql functions

I've always wondered why some people put a "@" in front of mysql functions, like:

Code:
<?php
   
   $query = @mysql_query("some query");

?>
So if anyone would care to explain? Thanks in advance.
Send a message via MSN to haskabab
haskabab is offline  
Reply With Quote
Old 08-14-2010, 05:36 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

it is a language construct that suppresses warnings and errors. In this case it won't stop the execution of the script if there is an error or warning.

It is a bad practice though, because if you don't get the results you expected you need to handle them accordingly so that the user of the app/website/script would have a better experience. Plus without it is better to debug.
tony is offline  
Reply With Quote
The Following User Says Thank You to tony For This Useful Post:
haskabab (08-14-2010)
Old 08-14-2010, 05:40 PM   #3 (permalink)
The Visitor
 
Join Date: Jun 2010
Posts: 4
Thanks: 1
haskabab is on a distinguished road
Default

Thanks once again xD!
Send a message via MSN to haskabab
haskabab is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Generating XML from a Mysql DB with PHP's DOM functions (part one) sketchMedia XML, XSLT, XPath, XQuery 10 03-05-2013 07:41 AM
Generating XML from a Mysql DB with PHP's DOM functions (part Two) sketchMedia XML, XSLT, XPath, XQuery 7 08-20-2008 12:02 AM
Securing your MySQL Queries with Sprintf Wildhoney General 26 03-18-2008 06:52 PM
5 Useful MySQL Functions And Control Flows Wildhoney MySQL & Databases 16 01-02-2008 08:44 PM
Notepage like application to open large MySQL files Wildhoney General 6 12-07-2007 02:18 PM


All times are GMT. The time now is 04:09 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design