{"id":447,"date":"2021-12-02T10:23:24","date_gmt":"2021-12-02T10:23:24","guid":{"rendered":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/?p=447"},"modified":"2021-12-02T11:05:52","modified_gmt":"2021-12-02T11:05:52","slug":"adding-data-information","status":"publish","type":"post","link":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/12\/02\/adding-data-information\/","title":{"rendered":"Adding Data information"},"content":{"rendered":"\n<p><a href=\"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/data\/add_data_devices.txt\">Adding data to the devices table<\/a><\/p>\n\n\n\n<p>You may wish to add a couple more items of data by modifying $query as follows and calling up the program in your browser again:<\/p>\n\n\n\n<p><strong>$query = &#8220;INSERT INTO devices VALUES(NULL, &#8216;Minidisc&#8217;, &#8216;Sony&#8217;, 2)&#8221;;<br>$query = &#8220;INSERT INTO devices VALUES(NULL, &#8216;Dat&#8217;, &#8216;Sony&#8217;, 3)&#8221;;<\/strong><\/p>\n\n\n\n<p>By the way, notice the NULL value passed as the first parameter? This is because the id column is of type AUTO_INCREMENT, and MySQL will decide what value to assign according to the next available number in sequence. So, we simply pass a NULL value, which will be ignored. Of course, the most efficient way to populate MySQL with data is to create an array and insert the data with a single query.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Adding data to the devices table You may wish to add a couple more items of data by modifying $query as follows and calling up the program in your browser again: $query = &#8220;INSERT INTO devices VALUES(NULL, &#8216;Minidisc&#8217;, &#8216;Sony&#8217;, 2)&#8221;;$query = &#8220;INSERT INTO devices VALUES(NULL, &#8216;Dat&#8217;, &#8216;Sony&#8217;, 3)&#8221;; By the way, notice the NULL value &hellip; <a href=\"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/2021\/12\/02\/adding-data-information\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Adding Data information<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/447"}],"collection":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/comments?post=447"}],"version-history":[{"count":3,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/447\/revisions"}],"predecessor-version":[{"id":451,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/posts\/447\/revisions\/451"}],"wp:attachment":[{"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/media?parent=447"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/categories?post=447"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/tietokanta.dy.fi:8243\/mikko\/wordpress\/index.php\/wp-json\/wp\/v2\/tags?post=447"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}