miniBB Support Forums | 15 years on The Web
miniBB ®

miniBB

®
 
 | Forums | Register | Reply | Search | Statistics | Manual |
Master Class miniBB Support Forums / Master Class /   
 

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
Lead Developer
#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 Support Forums / Master Class /
 Using db_simpleSelect for complex query
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


 ?
You are welcome to post anonymously, by entering a nickname with no password (if the similar Username has not been taken yet), or by leaving both fields empty. If you have a forums 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 Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
↑ TOP