miniBB ®
 
miniBB Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Files Bank for miniBB Enrich your miniBB-forums content, creating public files storage with the File Bank add-on!
Master Class miniBB Community Forum / Master Class /
Short link for this topic:

Using db_simpleSelect for complex query

Author Anonymous
Guest
#1 | Posted: 5 Oct 2006 05:46
Trying to write custom PHP using the db_simpleSelect function, but I want to select from two tables and do a SQL join. When I try it, I get no results. I checked syntax by running the query straight from the DB. Does db_simpleSelect just not like having two tables passed in?
Author Anonymous
Guest
#2 | Posted: 5 Oct 2006 05:52
P.S. Here is the syntax:

if($cols=db_simpleSelect(0,$Tt.' t, '.$Tp.' p','t.topic_id, t.topic_title, p.post_text','t.topic_id','=','p.topic_id','t.topic_id DESC',10))
Author Paul
CEO
#3 | Posted: 5 Oct 2006 10:02
Function name says it all: db_simpleSelect, so it's not a place for executing heavy queries.

Heavy queries are actually not the thing we like in miniBB. They are used only when there is no other way; but in most cases, there is a way to create TWO simple selects instead of ONE, but this will be hundred times FASTER else if you use complex query. It will be definitely executed slowly on large systems and active forums!
Master Class miniBB Community Forum / Master Class / Using db_simpleSelect for complex query Top
Your Reply Click this icon to move up to the quoted message

» Username  » Password 
You are welcome to post anonymously by entering a nickname with no password (if that nickname has not been taken by another member) or by leaving both fields empty. If you have a forums membership account, you can also sign in from this page without posting a message, or sign in and post at once.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
miniBB Community Forum Powered by Free Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts