| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| Senior Member | PHP Question I am working on a site and I need some info. I have a "Friends" Module (picture myspace) and I need to to only pull members of a certain group ID. I think this is where pulls th list of members to add.... $sqlstr ="SELECT uid, uname, level FROM ".$db->prefix("users")." WHERE level>0 AND uid!=$myid LIMIT $inf, $tranche"; But I need to to pull from 2 tables so it will also get the groupid . I have written the sql statement to pull from where I need to but cant figure out how to write it into php . here is the sql statement SELECT pop_users.uid, pop_users.uname, pop_groups_users_link.groupid FROM pop_users, pop_groups_users_link WHERE pop_users.uid = pop_groups_users_link.uid AND groupid =4 This pulls the info I need. Any help would be great.
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #2 (permalink) |
| Barru. | In php you will need to use the mysql_query function: PHP Code:
__________________ |
| |
| | #3 (permalink) |
| Senior Member | So there is no way just to add to this $sqlstr ="SELECT uid, uname, level FROM ".$db->prefix("users")." WHERE level>0 AND uid!=$myid LIMIT $inf, $tranche"; So it will pull from 2 places? Or maybe just add a groupid field to the user table?
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| Last edited by slipondajimmy; 02-24-2007 at 09:42 AM. |
| |
| | #5 (permalink) |
| Senior Member | i think that did it once I changed it to groups_users_link I still need to limit the result but I think I can handle that part . Thanks a bunch. There will be some more stuff I need to do im sure this thread should stay open..lol
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
| | #6 (permalink) |
| Senior Member | I do have another question. Lets say I have a list of 10 people and i would like people to post a bulletin on a site such as myspace, Like a train script. how would I go about doing that? All I really need is something what will display the code and the bottom of a page that a user can copy/paste into a bulletin could I use any information from my above posts to do that? any ideas?
__________________ Mascot Factory- Custom Plush, Promotional Plush, and Personalized Teddy Bears|The Squidget - The tiny travel trailer you build from plans| |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |