View Single Post
Old 12-05-2008, 10:02 AM   #5 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

Sorry to nit-pick here, but your try..catch block isn't doing much, you need to throw and exception before its caught:
PHP Code:
    if(!$q=mysql_query('SELECT ArticleID FROM articles'))
    {
        throw new 
Exception(mysql_error());
    } 
would do it, also there is no need for the 'exit' as and exception stops the current execution anyway.
I agree with Wildhoney about the curly braces, although not needed for PHP to execute it, it will make debugging harder in the future
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
sketchMedia is offline  
Reply With Quote