Hi

I'm trying to get all taxonomy titles from one term.


	$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

sagar ramgade’s picture

Hi,

Try this out

$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);

}

Acquia certified Developer, Back end and Front specialist
Need help? Please use my contact form

TomDS’s picture

Thank you Sagar, I already tried something like that, but I didn't managed to get it.
Your solution works great!

Tom