{"id":6906774,"date":"2016-01-05T04:02:09","date_gmt":"2016-01-05T04:02:09","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/help-with-sql-query-inside-insert_php\/"},"modified":"2016-08-31T00:02:49","modified_gmt":"2016-08-31T00:02:49","slug":"help-with-sql-query-inside-insert_php","status":"publish","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/help-with-sql-query-inside-insert_php\/","title":{"rendered":"Help with SQL query inside insert_php"},"content":{"rendered":"<p>Hello, hope you can help me with this. I&#8217;m trying to create a page in my wordpress site, which will store information in a separate mysql database from a form. First, I tried to insert the php code to connect to the database, to check if everything&#8217;s working, and it works fine. <\/p>\n<p>The problem starts when I use query to insert info in the database. Let&#8217;s say I do this:<\/p>\n<p>$var = INSERT INTO test (test_1, test_2,&#8230;) VALUES (&#8220;value_1&#8221;, &#8220;value_2&#8221;,&#8230;);<\/p>\n<p>And when I add that line of code, it just break up. There&#8217;s no content at all in the page when I preview everything (I inserted some messages like &#8220;Connected!&#8221; to check if everything&#8217;s okay, and it shows).<\/p>\n<p>My question is, am I doing something wrong? I don&#8217;t really have an specific code at all, I was just testing the plugin&#8230; So I would really appreciate if you could help me with this.<\/p>\n<p>Thanks, and congratulations for making such an amazing plugin.<\/p>\n<p>https:\/\/wordpress.org\/plugins\/insert-php\/<\/p>\n","protected":false},"template":"","class_list":["post-6906774","topic","type-topic","status-publish","hentry","topic-tag-forms","topic-tag-php","topic-tag-register","topic-tag-sql"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/6906774","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\/6906774\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=6906774"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}