This topic is locked

CustomQuery Based on the page id

9/16/2016 8:06:39 AM
PHPRunner General questions
S
skbrasil author

code snippet : I would love to create a query based on id to show the custom query format of the code snippet.
in my case I'm trying to customize the titles in the visualization page, based on the same page information, but independent exbindo control of PHPRunner via code snippet.
see my current example, is working, However it is not being filtered by the id of the current page.



$sql = "SELECT hosting_seo_title AS title FROM hosting group by hosting_id LIMIT 1";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "" . $data["title"];


---------------------------------------------------------

code snippet : Custom Query showing a field based on the page id

---------------------------------------------------------
http://localhost/review/blog_view.php?editid1=1
I would like to filter by: blog_view.php?

editid1=1
S
skbrasil author 9/22/2016



code snippet : I would love to create a query based on id to show the custom query format of the code snippet.
in my case I'm trying to customize the titles in the visualization page, based on the same page information, but independent exbindo control of PHPRunner via code snippet.
see my current example, is working, However it is not being filtered by the id of the current page.



$sql = "SELECT hosting_seo_title AS title FROM hosting group by hosting_id LIMIT 1";

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "" . $data["title"];


---------------------------------------------------------

code snippet : Custom Query showing a field based on the page id

---------------------------------------------------------
http://localhost/review/blog_view.php?editid1=1
I would like to filter by: blog_view.php?

editid1=1



Solved

$sql = "SELECT hosting_seo_title AS webhost FROM hosting where hosting_id=".$_GET["editid1"];

$rs = CustomQuery($sql);

$data = db_fetch_array($rs);

echo "" . $data["webhost"];