Nancy, I believe this can be because of some functions that cannot be chained, join is one of them, and that might be the reason you are facing issues.<br>Check this for chaining - <a href="http://drupal.org/node/1060924">http://drupal.org/node/1060924</a>.<br>
<br>You can use this query like this<br><div>$query = db_select('user_badges_roles', 'ubr')</div><div> ->fields('ubr', array('rid', 'ubb'))</div>
<div> ->join('user_badges_badges', 'ubb', 'ubb.bid = ubr.bid');<br><br>$query = condition('ubr.rid', '@todo Set the appropriate argument.')</div><div> ->execute();</div><br>
Try this, and you might get some success<br><br><div class="gmail_quote">On Tue, Oct 11, 2011 at 10:45 PM, Ms. Nancy Wichmann <span dir="ltr"><<a href="mailto:nan_wich@bellsouth.net">nan_wich@bellsouth.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color:#000;background-color:#fff;font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt">
<div style="font-family:arial,helvetica,sans-serif"><span>Same as Boobatower's. Not working for me.<br></span></div><div class="im"><div style="font-family:arial,helvetica,sans-serif"> </div><div><font size="4" color="#ff007f" face="bookman old style, new york, times, serif"><i><b>Nancy</b></i></font></div>
<div><font face="arial, helvetica, sans-serif">Injustice anywhere is a threat to justice everywhere. -- Dr. Martin L. King, Jr.</font></div></div><div><br><blockquote style="border-left:2px solid rgb(16, 16, 255);margin-left:5px;padding-left:5px">
<div style="font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:12pt"><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold">From:</span></b> sivaji j.g <<a href="mailto:sivaji2009@gmail.com" target="_blank">sivaji2009@gmail.com</a>><br>
<b><span style="font-weight:bold">To:</span></b> <a href="mailto:support@drupal.org" target="_blank">support@drupal.org</a>; Ms. Nancy Wichmann <<a href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>><br>
<b><span style="font-weight:bold">Sent:</span></b> Tuesday, October 11, 2011 1:05 PM<br><b><span style="font-weight:bold">Subject:</span></b> Re: [support] Converting a query to D7<br></font><div class="im"><br>
On Tue, Oct 11, 2011 at 9:05 PM, Ms. Nancy Wichmann<br><<a href="mailto:nan_wich@bellsouth.net" target="_blank">nan_wich@bellsouth.net</a>> wrote:<br>> Before I pull any more hair out, can someone properly convert this to a D7<br>
> select query, please:<br>> SELECT ubr.rid, ubb.* FROM {user_badges_roles} ubr INNER JOIN<br>> {user_badges_badges} ubb ON ubb.bid = ubr.bid WHERE ubr.rid = %d<br><br>I use this online service <a href="http://jonduell.com/sql-parser" target="_blank">http://jonduell.com/sql-parser</a>. It always<br>
worked good for my needs.<br></div></div></div></blockquote></div></div></div><br>--<br>
[ Drupal support list | <a href="http://lists.drupal.org/" target="_blank">http://lists.drupal.org/</a> ]<br></blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>Vaibhav Jain<br>