{"id":19018287,"date":"2026-09-12T08:06:05","date_gmt":"2026-09-12T08:06:05","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/argument-in-sql\/"},"modified":"2026-09-12T08:06:05","modified_gmt":"2026-09-12T08:06:05","slug":"argument-in-sql","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/argument-in-sql\/","title":{"rendered":"Argument in SQL"},"content":{"rendered":"<p>Hello,<\/p>\n<p>I have a SQL, something like this:<\/p>\n<pre><code>...WHERE p.post_type = &#039;myposttype&#039;\n    AND g.ID = &#039;arg1&#039;...<\/code><\/pre>\n<p>arg1 is a number, it is the ID of another custom post type. If I replace with the actual ID, query works fine.<\/p>\n<p>How should I reference this in the SQL and in the shortcode?<br \/>\nThese do not work:<br \/>\nSQL: <code>...AND g.ID = {arg1}...<\/code><br \/>\nIn a page: <code>[gvn_schart_2 id=&quot;605&quot; arg1=&quot;41&quot;]<\/code><\/p>\n<p>Please check it out,<\/p>\n<p>Thank you,<br \/>\nKostas<\/p>\n","protected":false},"template":"","class_list":["post-19018287","topic","type-topic","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19018287","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/19018287\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=19018287"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}