{"id":4765,"date":"2012-05-28T10:50:07","date_gmt":"2012-05-28T10:50:07","guid":{"rendered":"http:\/\/phpcodez.com\/?p=4765"},"modified":"2012-05-28T10:50:07","modified_gmt":"2012-05-28T10:50:07","slug":"sql-insert","status":"publish","type":"post","link":"http:\/\/phpcodez.com\/sql-insert\/","title":{"rendered":"SQL INSERT INTO"},"content":{"rendered":"<p>It insert a new row in a table<\/p>\n<p><strong>SQL INSERT INTO Syntax<\/strong><\/p>\n<p>It can be used in two form<\/p>\n<p>1) Without mentioning column names . In that case we must enter values for all fields .<\/p>\n<p>INSERT INTO table_name VALUES (value1, value2.)<\/p>\n<p>2) By mentioning column names and values<\/p>\n<p>INSERT INTO table_name (column1, column2) VALUES (value1, value2)<\/p>\n<p><strong>MySQL Table &#8211; users<\/strong><\/p>\n<p>+&#8212;-+&#8212;&#8212;+<br \/>\n| id | name |<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| \u00a01 | PHP \u00a0|<br \/>\n| \u00a02 | JS \u00a0\u00a0|<br \/>\n| \u00a03 | HTML |<br \/>\n| \u00a04 | PHP \u00a0|<br \/>\n+&#8212;-+&#8212;&#8212;+<\/p>\n<p><strong>Example<\/strong><\/p>\n<p>mysql&gt; INSERT INTO users values(5,&#8221;AS&#8221;);<br \/>\nQuery OK, 1 row affected (0.02 sec)<\/p>\n<p>mysql&gt; select * from users \u00a0;<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| id | name |<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n| \u00a01 | PHP \u00a0|<br \/>\n| \u00a02 | JS \u00a0\u00a0|<br \/>\n| \u00a03 | HTML |<br \/>\n| \u00a04 | PHP \u00a0|<br \/>\n| \u00a05 | AS \u00a0\u00a0|<br \/>\n+&#8212;-+&#8212;&#8212;+<br \/>\n5 rows in set (0.00 sec)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It insert a new row in a table SQL INSERT INTO Syntax It can be used in two form 1) Without mentioning column names . In that case we must enter values for all fields . INSERT INTO table_name VALUES (value1, value2.) 2) By mentioning column names and values INSERT INTO table_name (column1, column2) VALUES &hellip; <a href=\"http:\/\/phpcodez.com\/sql-insert\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">SQL INSERT INTO<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[31],"tags":[332,370,392,457,461],"class_list":["post-4765","post","type-post","status-publish","format-standard","hentry","category-sql","tag-mysql","tag-php","tag-query","tag-sql","tag-statement"],"_links":{"self":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4765","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/comments?post=4765"}],"version-history":[{"count":0,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/posts\/4765\/revisions"}],"wp:attachment":[{"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/media?parent=4765"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/categories?post=4765"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/phpcodez.com\/wp-json\/wp\/v2\/tags?post=4765"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}