{"id":7285,"date":"2014-06-03T23:35:14","date_gmt":"2014-06-03T23:35:14","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/syntax-error-unexpected-t_encapsed-php-collection-of-common-programming-errors\/"},"modified":"2014-06-03T23:35:14","modified_gmt":"2014-06-03T23:35:14","slug":"syntax-error-unexpected-t_encapsed-php-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/06\/03\/syntax-error-unexpected-t_encapsed-php-collection-of-common-programming-errors\/","title":{"rendered":"syntax error unexpected T_ENCAPSED&hellip; php-Collection of common programming errors"},"content":{"rendered":"<p>In PHP, every statement ends with a semocolon.<\/p>\n<p>So add a semocolon (<code>;<\/code>) to your line.<\/p>\n<p>Again, you are not adding single quotes (<code>'<\/code>) to your posted values.<\/p>\n<p>So, in total, update your query to:<\/p>\n<pre><code>\"INSERT INTO feedback_test (FirstName, LastName, Age) VALUES\n('$_POST[\\'firstname\\']','$_POST[\\'lastname\\']','$_POST[\\'age\\']')\";\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>In PHP, every statement ends with a semocolon. So add a semocolon (;) to your line. Again, you are not adding single quotes (&#8216;) to your posted values. So, in total, update your query to: &#8220;INSERT INTO feedback_test (FirstName, LastName, Age) VALUES (&#8216;$_POST[\\&#8217;firstname\\&#8217;]&#8217;,&#8217;$_POST[\\&#8217;lastname\\&#8217;]&#8217;,&#8217;$_POST[\\&#8217;age\\&#8217;]&#8217;)&#8221;;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7285","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7285","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7285"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7285\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7285"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7285"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7285"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}