{"id":179,"date":"2016-08-04T14:50:07","date_gmt":"2016-08-04T14:50:07","guid":{"rendered":"http:\/\/www.abracarnatureza.eu\/?page_id=179"},"modified":"2017-04-28T14:57:53","modified_gmt":"2017-04-28T14:57:53","slug":"pontos-de-interesse","status":"publish","type":"page","link":"http:\/\/www.abracarnatureza.eu\/?page_id=179","title":{"rendered":"Pontos de Interesse"},"content":{"rendered":"\n<div class=\"twitter-share\"><a href=\"https:\/\/twitter.com\/intent\/tweet\" class=\"twitter-share-button\">Tweet<\/a><\/div>\n<script>\n  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){\n  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),\n  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)\n  })(window,document,'script','https:\/\/www.google-analytics.com\/analytics.js','ga');\n\n  ga('create', 'UA-98306364-1', 'auto');\n  ga('send', 'pageview');\n\n<\/script>\n\n<div class=\"entry\">\n<?php\n\n\nglobal $wpdb;           \/* wpdb class should not be called directly.global $wpdb variable is an instantiation of the class already set up to talk to the WordPress database *\/ \nglobal $table_prefix;   \/* vari\u00e1vel global com o prefixo dos nomes das tabelas da base de dados do wordpress *\/\n\n$result = $wpdb->get_results( &#8220;select count(&#8220;.$table_prefix.&#8221;gmp_markers.id) as soma from &#8220;.$table_prefix.&#8221;gmp_markers&#8221;);<\/p>\n<p>\/*mulitple row results can be pulled from the database with get_results function and outputs an object which is stored in $result *\/<\/p>\n<p>\/\/ echo &#8220;<\/p>\n<pre>\"; print_r($result); echo \"<\/pre>\n<p>&#8220;;<br \/>\n\/* If you require you may print and view the contents of $result object *\/<\/p>\n<p>echo &#8220;<strong>Quantidade de PI&#8217;s:<\/strong> &#8220;;<br \/>\nforeach($result as $row) \/* wpdb class should not be called directly.global $wpdb variable is an instantiation of the class already set up to talk to the WordPress database *\/<br \/>\n {<br \/>\n echo $row->soma;<br \/>\n }<br \/>\n?><\/p>\n<p><?php\n\nglobal $wpdb;           \/* wpdb class should not be called directly.global $wpdb variable is an instantiation of the class already set up to talk to the WordPress database *\/ \nglobal $table_prefix;   \/* vari\u00e1vel global com o prefixo dos nomes das tabelas da base de dados do wordpress *\/\n\n$result = $wpdb->get_results( &#8220;select &#8220;.$table_prefix.&#8221;gmp_marker_groups.title,count(&#8220;.$table_prefix.&#8221;gmp_markers.id) as soma from &#8220;.$table_prefix.&#8221;gmp_markers inner join &#8220;.$table_prefix.&#8221;gmp_marker_groups on &#8220;.$table_prefix.&#8221;gmp_markers.marker_group_id=&#8221;.$table_prefix.&#8221;gmp_marker_groups.id group by title&#8221;);<\/p>\n<p>\/*mulitple row results can be pulled from the database with get_results function and outputs an object which is stored in $result *\/<\/p>\n<p>\/\/ echo &#8220;<\/p>\n<pre>\"; print_r($result); echo \"<\/pre>\n<p>&#8220;;<br \/>\n\/* If you require you may print and view the contents of $result object *\/<\/p>\n<p>echo &#8220;<\/p>\n<table>&#8220;;<br \/>\necho &#8220;<\/p>\n<tr>\n<th>Tipo<\/th>\n<th>Quantidade<\/th>\n<p>&#8220;;<br \/>\nforeach($result as $row) \/* wpdb class should not be called directly.global $wpdb variable is an instantiation of the class already set up to talk to the WordPress database *\/<br \/>\n {<br \/>\n echo &#8220;<\/p>\n<tr>&#8220;;<br \/>\n echo &#8220;<\/p>\n<td>&#8220;.$row->title.&#8221;<\/td>\n<td>&#8220;.$row->soma.&#8221;<\/td>\n<p>&#8220;;<br \/>\n echo &#8220;<\/tr>\n<p>&#8220;;<br \/>\n }<br \/>\necho &#8220;<\/table>\n<p>&#8220;;<br \/>\n?><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":4,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_mi_skip_tracking":false,"_links_to":"","_links_to_target":""},"_links":{"self":[{"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/pages\/179"}],"collection":[{"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=179"}],"version-history":[{"count":46,"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/pages\/179\/revisions"}],"predecessor-version":[{"id":1477,"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=\/wp\/v2\/pages\/179\/revisions\/1477"}],"wp:attachment":[{"href":"http:\/\/www.abracarnatureza.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}