minibb®
Fight the automated spam - protect your miniBB-forums,
getting the Captcha addon! Click here to read more.
Captcha Addon for miniBB
Community Forum
 | Forums | File Bank | Sign Up | Reply | Search | Statistics | Manual |
Master Class miniBB Community Forum / Master Class /

Using db_simpleSelect for complex query

 
Anonymous
Guest
#1 | Posted: 5 Oct 2006 05:46
Reply 
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?
Anonymous
Guest
#2 | Posted: 5 Oct 2006 05:52
Reply 
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))
Paul
CEO
#3 | Posted: 5 Oct 2006 10:02
Reply 
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!
 
Your reply
Bold Style  Italic Style  Image Link  URL Link 


» 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, be sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.

 
Online now: Guests - 40
Members - 0
Most users ever online: 191 [24 Dec 2007 14:33]
Guests - 191 / Members - 0

Forums are powered by miniBB®