{"id":429,"date":"2016-09-10T15:31:41","date_gmt":"2016-09-10T14:31:41","guid":{"rendered":"http:\/\/www.yellowweb.id\/blog\/?p=429"},"modified":"2016-09-10T15:31:41","modified_gmt":"2016-09-10T14:31:41","slug":"php-dan-mysqli","status":"publish","type":"post","link":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/","title":{"rendered":"PHP dan MySQLi"},"content":{"rendered":"<p>MySQLi adalah pengembagan dari MySQL. Huruf i diakhir artinya Improved (yang disempurnakan). Ada beberapa alasan mengapa kita harus migrasi dari MySQL ke MySQLi. So mari kita lihat perbandingannya,&#8230;<\/p>\n<p><!--more--><\/p>\n<p>Sebenarnya kalau kita cermati, dari struktur tabel dan tampilan tidak ada perbedaan yang mencolok, namun hal ini terasa berbeda ketika melihat dari sisi performa. MySQLi lebih cepat dibandingkan dengan MySQL.<\/p>\n<table style=\"height: 390px;\" width=\"733\">\n<tbody>\n<tr>\n<td><strong>Point<\/strong><\/td>\n<td><strong>MySQL<\/strong><\/td>\n<td><strong>MySQLi<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Pengembangan<\/td>\n<td>Sudah tidak lagi di kembangkan<\/td>\n<td>Masih terus dikembangkan<\/td>\n<\/tr>\n<tr>\n<td>Support Resmi<\/td>\n<td><em>Deprecated<\/em><\/td>\n<td><em>Long term support<\/em><\/td>\n<\/tr>\n<tr>\n<td>Mendukung OOP<\/td>\n<td>Tidak<\/td>\n<td>Ya<\/td>\n<\/tr>\n<tr>\n<td>Mendukung Prepare statement<\/td>\n<td>Tidak<\/td>\n<td>Ya<\/td>\n<\/tr>\n<tr>\n<td>Mendukung Store procedur<\/td>\n<td>Tidak<\/td>\n<td>Ya<\/td>\n<\/tr>\n<tr>\n<td>Mendukung Transaksi (commit, rollback)<\/td>\n<td>Tidak<\/td>\n<td>Ya<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Dari tabel diatas kita bisa melihat bahwa, banyak kelebihan MySQLi dibandingkan dengan MySQL.<\/p>\n<p>Berikut ini dilihat dari perbandingan struktur penulisan Prosedural dan OOP, sebagai berikut:<\/p>\n<table>\n<tbody>\n<tr>\n<td><strong>Hal<\/strong><\/td>\n<td><strong>MySQL<\/strong><\/td>\n<td><strong>MySQLi Prosedural<\/strong><\/td>\n<td><strong>MySQLi OOP<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Koneksi database<\/td>\n<td>mysql_connect()<\/td>\n<td>mysqli_connect()<\/td>\n<td><code>$db = new mysqli(db_host,db_user,db_pass,db_name);<\/code><\/td>\n<\/tr>\n<tr>\n<td>Query select<\/td>\n<td>mysql_query()<\/td>\n<td>mysqli_query()<\/td>\n<td><code> $db-&gt;query($sql)<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Berikut penggalan contoh cara melakukan koneksi ke database<\/p>\n<pre class=\"lang:default decode:true \">&lt;?php\r\n\r\n$dbconfig = mysqli_connect(\"localhost\",\"root\",\"\",\"yelloww1_yellowweb\") or die (mysql_error());\r\n\r\n\/**\r\n * Created by PhpStorm.\r\n * User: faroq\r\n * Date: 7\/5\/2015\r\n * Time: 11:51 AM\r\n *\/<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQLi adalah pengembagan dari MySQL. Huruf i diakhir artinya Improved (yang disempurnakan). Ada beberapa alasan mengapa kita harus migrasi dari MySQL ke MySQLi. So mari kita lihat perbandingannya,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":431,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[190,110],"tags":[192,248,191,88],"class_list":["post-429","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mysql","category-php","tag-database","tag-msqli","tag-mysql","tag-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>PHP dan MySQLi - YELLOWWEB.ID<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP dan MySQLi - YELLOWWEB.ID\" \/>\n<meta property=\"og:description\" content=\"MySQLi adalah pengembagan dari MySQL. Huruf i diakhir artinya Improved (yang disempurnakan). Ada beberapa alasan mengapa kita harus migrasi dari MySQL ke MySQLi. So mari kita lihat perbandingannya,&#8230;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/\" \/>\n<meta property=\"og:site_name\" content=\"YELLOWWEB.ID\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-10T14:31:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg?fit=750%2C350&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"750\" \/>\n\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"yellowweb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"yellowweb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/\"},\"author\":{\"name\":\"yellowweb\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"headline\":\"PHP dan MySQLi\",\"datePublished\":\"2016-09-10T14:31:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/\"},\"wordCount\":151,\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/mysql.jpg\",\"keywords\":[\"database\",\"msqli\",\"mysql\",\"php\"],\"articleSection\":[\"MySQL\",\"PHP\"],\"inLanguage\":\"en-GB\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/\",\"name\":\"PHP dan MySQLi - YELLOWWEB.ID\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/mysql.jpg\",\"datePublished\":\"2016-09-10T14:31:41+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/mysql.jpg\",\"contentUrl\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/09\\\/mysql.jpg\",\"width\":750,\"height\":350,\"caption\":\"mysql vs mysqli\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/php-dan-mysqli\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP dan MySQLi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/\",\"name\":\"YELLOWWEB.ID\",\"description\":\"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/#\\\/schema\\\/person\\\/75188044e080844724e381ab6a5b9829\",\"name\":\"yellowweb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g\",\"caption\":\"yellowweb\"},\"sameAs\":[\"https:\\\/\\\/www.yellowweb.id\"],\"url\":\"https:\\\/\\\/www.yellowweb.id\\\/blog\\\/author\\\/yellowweb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP dan MySQLi - YELLOWWEB.ID","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/","og_locale":"en_GB","og_type":"article","og_title":"PHP dan MySQLi - YELLOWWEB.ID","og_description":"MySQLi adalah pengembagan dari MySQL. Huruf i diakhir artinya Improved (yang disempurnakan). Ada beberapa alasan mengapa kita harus migrasi dari MySQL ke MySQLi. So mari kita lihat perbandingannya,&#8230;","og_url":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/","og_site_name":"YELLOWWEB.ID","article_published_time":"2016-09-10T14:31:41+00:00","og_image":[{"width":750,"height":350,"url":"https:\/\/i0.wp.com\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg?fit=750%2C350&ssl=1","type":"image\/jpeg"}],"author":"yellowweb","twitter_card":"summary_large_image","twitter_misc":{"Written by":"yellowweb","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#article","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/"},"author":{"name":"yellowweb","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"headline":"PHP dan MySQLi","datePublished":"2016-09-10T14:31:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/"},"wordCount":151,"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg","keywords":["database","msqli","mysql","php"],"articleSection":["MySQL","PHP"],"inLanguage":"en-GB"},{"@type":"WebPage","@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/","url":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/","name":"PHP dan MySQLi - YELLOWWEB.ID","isPartOf":{"@id":"https:\/\/www.yellowweb.id\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#primaryimage"},"image":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#primaryimage"},"thumbnailUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg","datePublished":"2016-09-10T14:31:41+00:00","author":{"@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829"},"breadcrumb":{"@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/"]}]},{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#primaryimage","url":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg","contentUrl":"https:\/\/www.yellowweb.id\/blog\/wp-content\/uploads\/2016\/09\/mysql.jpg","width":750,"height":350,"caption":"mysql vs mysqli"},{"@type":"BreadcrumbList","@id":"https:\/\/www.yellowweb.id\/blog\/php-dan-mysqli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.yellowweb.id\/blog\/"},{"@type":"ListItem","position":2,"name":"PHP dan MySQLi"}]},{"@type":"WebSite","@id":"https:\/\/www.yellowweb.id\/blog\/#website","url":"https:\/\/www.yellowweb.id\/blog\/","name":"YELLOWWEB.ID","description":"Kursus Web Design | Kursus Web Programming | Mobile Web Apps | Digital Marketing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.yellowweb.id\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.yellowweb.id\/blog\/#\/schema\/person\/75188044e080844724e381ab6a5b9829","name":"yellowweb","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5afd1bfac26e9377e8f5e36afb624cf3690dd31cb07c3961dfbc736b9ff1912f?s=96&d=mm&r=g","caption":"yellowweb"},"sameAs":["https:\/\/www.yellowweb.id"],"url":"https:\/\/www.yellowweb.id\/blog\/author\/yellowweb\/"}]}},"_links":{"self":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/429","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/comments?post=429"}],"version-history":[{"count":2,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/429\/revisions"}],"predecessor-version":[{"id":432,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/posts\/429\/revisions\/432"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media\/431"}],"wp:attachment":[{"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/media?parent=429"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/categories?post=429"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yellowweb.id\/blog\/wp-json\/wp\/v2\/tags?post=429"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}