Posted by TomDS on September 8, 2010 at 2:03pm
Hi
I'm trying to get all taxonomy titles from one term.
<?php
$sql = 'SELECT node.nid, node.title, term_node.tid
FROM {node}
INNER JOIN {term_node}
ON node.vid = term_node.vid
WHERE tid = %d';
$sql = db_rewrite_sql($sql);
dsm($sql);
?>This is the code I'm using, but that gives me this problem:
recoverable fatal error: Object of class mysqli_result could not be converted to string in ...
So, what am I doing wrong?
Thank you
Comments
Hi, Try this out <?php$sql =
Hi,
Try this out
<?php
$sql = 'SELECT node.nid, node.title, term_node.tid FROM {node} node INNER JOIN {term_node} term_node ON node.vid = term_node.vid WHERE tid = %d';
$result = db_query($sql);
while ($row = db_fetch_object($result)) {
kpr($row);
}
?>
Need Drupal help?
Reach Me
Share your Posts, Url, Sites
www.sociopost.com
Thank you Sagar, I already
Thank you Sagar, I already tried something like that, but I didn't managed to get it.
Your solution works great!
Tom