Jamroom Logo Jamroom 5 Core
is now Open Source!
User Support Forum Archive (Read Only)
Jamroom Developers:
'dbQuery' with 'or die()'
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 01/23/09 19:55 
can you use 'or die()' syntax with the internal function dbQuery?

Code
// get the data from the database
$results = dbQuery($sql, 'NUMERIC') or die ('Error getting the results');



_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Brian
Jamroom Team


Joined: 09 Jul 2003
Posts: 37583
Location: Seattle, WA

Posted: 01/23/09 20:33 
You would want to check $result - that WILL work for some instances, but not all. $results will contain any errors encountered, but they will already be logged to the Activity Log. For the most part you only need to check that $results contains what you want - i.e.


Code

$results = dbQuery($sql, 'NUMERIC');
if (isset($results) && is_array($results)) {
   ... do what you want ...
}
else {
   jrNoticePage('error',"an error was encountered: $results");
}


Hope this helps!

- Brian


_________________
Make sure and check out:
* The Jamroom FAQ
* The Jamroom Documentation
Back to top
Michael
Jamroom Team


Joined: 22 Apr 2008
Posts: 3423
Location: Tokyo

Posted: 01/23/09 21:12 
Thanks very much. Smile


_________________
Michael Ussher
Jamroom Network Team Member: http://www.jamroom.net
Priority Support: http://www.jamroom.net/Support_Center
Back to top
Display posts from previous:   
User Support Forum Archive (Read Only)
Jamroom Developers

 
Solutions
• Social Media Platform
• Social Networking Software
• Musician Website Manager
• Community Builder
Products
• Jamroom Core
• Jamroom Addons
• Jamroom Modules
• Jamroom Marketplace
Support
• Support Forum
• Documentation
• Support Center
• Contact Support
Community
• Community Forum
• Member Sites
• Developers
Company
• About Us
• Contact Us
• Privacy Policy
©2003 - 2010 Talldude Networks, LLC.