Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 04-08-2010, 09:56 PM
Seapyramid Seapyramid is offline
Premium Member
 
Join Date: Feb 2009
Posts: 373
Gender: Female
Credits: 15,943
Seapyramid
Default RE: Join query for optimization?

The query is wrong. You are selecting from multiple tables.. but not telling it what to look for in what table.
FROM ".$prefix."owned_adoptables AS a JOIN
PHP Code:
SELECT *                                                                       
FROM adopts_adoptables AS a JOIN adopts_owned_adoptables AS b ON  a.aid=b.aid 
JOIN adopts_levels  
AS c ON a.aid=c.aid           
WHERE  
`a.aid` = 144 AND                            
`
a.type` = `adopts_adoptables`.`type` AND          
(`
adopts_levels`.`adoptiename` = `adopts_adoptables`.`type` OR                
`
adopts_owned_adoptables`.`currentlevel` = 0) AND                       
(`
adopts_owned_adoptables`.`currentlevel` = `adopts_levels`.`thisislevel`
 OR `
adopts_owned_adoptables`.`currentlevel` = 0)                            
LIMIT 1 
This isn't fully complete.. but you can see my changes & work with the pattern on what the WHERE is.

Sea
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Query: COUNT(*) Kyttias Questions and Supports 5 01-19-2015 03:57 AM
CSS Query .-. ChibiMaestro Templates and Themes 2 12-08-2012 05:51 AM
Delete query deletes from all usesrs SilverDragonTears Questions and Supports 8 05-14-2012 07:49 PM
Having a problem running a query !Alive Questions and Supports 8 03-11-2012 02:39 PM
MySQL Query Empty on default install? (i.e. No edits.) Flametail Questions and Supports 3 10-18-2011 12:30 PM


All times are GMT -5. The time now is 02:59 AM.

Currently Active Users: 693 (0 members and 693 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636