How can i print multiple query output in GLOBAL:PHP view field? I have custom global:php fields on which I put the following code as value.

$shop_url=db_query("select page_url from mytable1 where user_id=$row-&gt;uid");
return $shop_url;


As output code, I put the following one.

foreach($shop_url as $data) {
  print($data-&gt;page_url);
}


I am getting no output. How can I achieve printing multiple database results in GLOBAL:PHP?
There are many errors in your code :)

First, don't use $data variable, as it's already used in your view ; check the available variables section under your php inputs. Normally, it's advised to use $static.

Second, did you check elsewhere that

$shop_url=db_query("select page_url from mytable1 where user_id=$row-&gt;uid");

returns something ? Because I would have thought that only

$shop_url=db_query("select page_url from mytable1 where user_id=:uid", array(':uid' =&gt; $row-&gt;uid));

would work.