Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL
Author Message
eldorado
Involved
Involved



Joined: Sep 10, 2008
Posts: 424
Location: France,Translator

PostPosted: Sat Nov 14, 2009 7:24 pm Reply with quote

Good evening folks...i'm having a bit of trouble finding my way in MySQL queries.

here is my first table called "food"
id-->Meal-->Position
1-->Steak-->Brother
2-->Salad-->Mom
3-->Steak-->Dad
4-->Soup--->Mom
5-->Tacos--> Dad

and my second one called "familly"
Position-->Age
Dad-->41
Mom-->45
Daughter-->17
Dog-->

I was wondering how to query this:
What is the age of the first familly member who likes steak?

Good night

_________________
Only registered users can see links on this board! Get registered or login! (My RN site)- Only registered users can see links on this board! Get registered or login!(cod4 clan) - Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website MSN Messenger
Raven
Site Admin/Owner



Joined: Aug 27, 2002
Posts: 17088

PostPosted: Sat Nov 14, 2009 10:45 pm Reply with quote

Try

SELECT * FROM food f, family fa
WHERE f.meal='steak'
AND
f.position=fa.position
LIMIT 1
 
View user's profile Send private message
eldorado







PostPosted: Sun Nov 15, 2009 5:26 am Reply with quote

Thanks raven , will try that now Smile

ps: would that work?
Code:
$dbquery = 'SELECT gtag FROM '.$prefix.'_nsngr_groups gr , '.$prefix.'_nsngr_users ug WHERE ug.uid ='.$uid.' AND gr.gid=ug.gid LIMIT 1';

$tag = $db->sql_query($dbquery);

I've added a field in nsngr_groups called gtag.

without the prefix it would do that
Code:
$dbquery = 'SELECT gtag FROM nuke_nsngr_groups gr , nuke_nsngr_users ug WHERE ug.uid ='.$uid.' AND gr.gid=ug.gid LIMIT 1';

$tag = $db->sql_query($dbquery);


pps : I see no reason why it wouldn't work Wink


Last edited by eldorado on Sun Nov 15, 2009 3:43 pm; edited 1 time in total 
montego
Site Admin



Joined: Aug 29, 2004
Posts: 9457
Location: Arizona

PostPosted: Sun Nov 15, 2009 12:55 pm Reply with quote

eldorado, I sure hope when you added the column to nsngr_groups that you also modified Edit Groups to work properly with that new column. Sure makes upgrades more difficult...

_________________
Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
eldorado







PostPosted: Sun Nov 15, 2009 4:06 pm Reply with quote

montego wrote:
eldorado, I sure hope when you added the column to nsngr_groups that you also modified Edit Groups to work properly with that new column. Sure makes upgrades more difficult...

You assume well , and you would assume I took security into account too.Which I did , however upgrades will still be small daggers which dissuade me from doing anything to the core files...grrr
I hope you guys won't touch that part of the core or I'm going to hang myself before igniting me with some toxic substance , else nuke myself Razz

Other solution would be to send you my modified files and see if it sparks any interests...

Btw , i'm also adding (merely trying to add) group colors to Groups , rather than using the cookie cutter deprecated AUC 1.0.5 from aUstiN which was rather cool two and a half year ago but fails miserably when it comes to admin control and cannot compete faced to RN2.4
 
montego







PostPosted: Mon Nov 16, 2009 5:49 pm Reply with quote

Well, while not planned out yet, there has been serious discussion about incorporating Groups management right into the Edit Users (RNYA). While we crack open the core, it might be a good time to add some additional capabilities... Wink Personally, I would love to see a new API, one in which would enable far more granular permission capabilities... but that is just a montego "pipe dream".
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> MySQL

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©