{"id":13923,"date":"2016-07-13T20:31:10","date_gmt":"2016-07-13T17:31:10","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=13923"},"modified":"2016-07-13T20:31:10","modified_gmt":"2016-07-13T17:31:10","slug":"creating-complete-blog-crud-using-mysql-php","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/","title":{"rendered":"Creating a complete blog (CRUD) using MySQL and PHP"},"content":{"rendered":"<p>Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a default option.<\/p>\n<p>For many new developers, the functionality of the blogs remains a mystery. Blogs have become so tightly integrated with the overall structure of the CMS (especially WP, Joomla and Drupal) that it is not easy to discern \u00a0the working of the blog from the rest of the CMS.<\/p>\n<p>This two-part tutorial is intended to show new developers the architecture of a blog and how this architecture functions. The first part of the tutorial will deal with a post class that performs CRUD functions for the data of the blog. The second part of the tutorial will demonstrate the usage of the post class at a page that will show, create and delete blog posts using the capabilities of the class.<\/p>\n<p>Let\u2019s get started with the first part by creating the database.<\/p>\n<h2>Step 1: Create the Database<\/h2>\n<p>Open <b>MySQL Manager<\/b> and create a new database. Name it <b>blog<\/b> for now. In the newly created database, create a new table with the following schema:<\/p>\n<pre class=\"brush:sql\">CREATE TABLE `post` (\r\n  `article_id` int(11) NOT NULL AUTO_INCREMENT,\r\n  `article_name` varchar(255) NOT NULL,\r\n  `article_content` text NOT NULL,\r\n  `img` varchar(50) NOT NULL,\r\n  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\r\n);<\/pre>\n<p>This schema is easy to understand. First item is the post id that auto increments. Next are the name, body, image and the date of publication.<\/p>\n<p>Now that the database and the appropriate table have been created, let\u2019s create a class that will handle database connectivity.<\/p>\n<h2>Step 2: Connecting to the Database<\/h2>\n<p>I will use <strong>MySQLi<\/strong> to connect to the database and perform database queries. Following is the code for connecting to the database.<\/p>\n<pre class=\"brush:sql\">class DbConnection\r\n{\r\n    protected $conn = null;\r\n    public function OpenCon()\r\n    {\r\n        $this-&gt;conn = new mysqli(servername, username, password, dbname) or die($conn-&gt;connect_error);\r\n        return $this-&gt;conn;\r\n    }\r\n    public function CloseCon()\r\n    {\r\n        $this-&gt;conn-&gt;close();\r\n    }\r\n}<\/pre>\n<p>This class will be used to open and handle the connectivity. Next up is the actual class that will perform CRUD operations.<\/p>\n<h2>Step 3: Class Post: Create a Post<\/h2>\n<p>Let\u2019s first create a new class <b>Post<\/b> and a constructor that will handle database connectivity:<\/p>\n<pre class=\"brush:php\">&lt;?php\r\ninclude \"DbConnection.php\";\r\n\r\n\r\nclass Post\r\n{\r\n\r\n    protected $db      = null;\r\n   \r\n\r\n    public function __construct()\r\n    {\r\n\r\n        $this-&gt;db      = new DbConnection();\r\n        \r\n\r\n    }<\/pre>\n<p>Now, let\u2019s create a new function which will handle new post request and save it to the database.<\/p>\n<pre class=\"brush:sql\"> public function insertpost($a_name, $a_content, $imgname)\r\n    {\r\n\r\n        $con     = $this-&gt;db-&gt;OpenCon();\r\n        $title   = $con-&gt;real_escape_string($a_name);\r\n        $content = $con-&gt;real_escape_string($a_content);\r\n        $img     = $con-&gt;real_escape_string($imgname);\r\n        $query   = $con-&gt;prepare(\"INSERT INTO post(article_name, article_content, img) VALUES(?, ?, ?)\");\r\n        $query-&gt;bind_param(\"sss\", $title, $content, $img);\r\n        $result = $query-&gt;execute();\r\n        if (!$result) {\r\n\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n    }<\/pre>\n<p>The above function saves the post in the database and return true if there are no errors.<\/p>\n<h2>Step 4: Class Post: Getting a Post<\/h2>\n<p>Now let\u2019s create a function which will get the post in order to view it.<\/p>\n<pre class=\"brush:sql\">public function getarticle($articleid)\r\n    {\r\n        $con = $this-&gt;db-&gt;OpenCon();\r\n\r\n        $stmt = \"SELECT article_name,article_content,img,date from post WHERE article_id = '$articleid'\";\r\n\r\n        $result = $con-&gt;query($stmt);\r\n\r\n        if ($result-&gt;num_rows == 1) {\r\n            $sql = $result;\r\n        } else {\r\n            $sql = \"No article\";\r\n        }\r\n\r\n        $this-&gt;db-&gt;CloseCon();\r\n\r\n        return $sql;\r\n\r\n    }<\/pre>\n<p>The above function gets the id of the post and will return the appropriate post. Now let\u2019s create a function that will update a post.<\/p>\n<h2>Step 5: Class Post: Updating a Post<\/h2>\n<p>In a blog, editing and updating a post is a common activity. The following function handles all such requests:<\/p>\n<pre class=\"brush:sql\"> public function updatearticle($a_id, $a_content, $a_name, $a_image)\r\n    {\r\n\r\n        $con     = $this-&gt;db-&gt;OpenCon();\r\n        $title   = $con-&gt;real_escape_string($a_name);\r\n        $content = $con-&gt;real_escape_string($a_content);\r\n        $img     = $con-&gt;real_escape_string($imgname);\r\n        $query   = $con-&gt;prepare(\"UPDATE post SET article_name = ? , article_content = ?, img = ? WHERE article_id = ?\");\r\n        $query-&gt;bind_param(\"sssi\", $title, $content, $img, $a_id);\r\n        $result = $query-&gt;execute();\r\n        if (!$result) {\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n\r\n    }<\/pre>\n<p>Now we have created, updated and read our post let\u2019s create a function which will delete it.<\/p>\n<h2>Step 6: Class Post: Delete a Post<\/h2>\n<p>Delete Post function takes a single parameter, post id and deletes the associated post:<\/p>\n<pre class=\"brush:sql\">public function deletearticle($id)\r\n    {\r\n\r\n        $con    = $this-&gt;db-&gt;OpenCon();\r\n        $sql    = \"DELETE FROM post WHERE article_id = '$id'\";\r\n        $result = $con-&gt;query($sql);\r\n\r\n        if (!$result) {\r\n\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n    }<\/pre>\n<h2>To Recap:<\/h2>\n<p>Here is the complete structure of the <b>Post class:<\/b><\/p>\n<pre class=\"brush:php\">&lt;?php\r\ninclude \"DbConnection.php\";\r\n\r\nclass Post\r\n{\r\n\r\n    protected $db = null;\r\n\r\n    public function __construct()\r\n    {\r\n\r\n        $this-&gt;db = new DbConnection();\r\n\r\n    }\r\n    public function insertpost($a_name, $a_content, $imgname)\r\n    {\r\n\r\n        $con     = $this-&gt;db-&gt;OpenCon();\r\n        $title   = $con-&gt;real_escape_string($a_name);\r\n        $content = $con-&gt;real_escape_string($a_content);\r\n        $img     = $con-&gt;real_escape_string($imgname);\r\n        $query   = $con-&gt;prepare(\"INSERT INTO post(article_name, article_content, img) VALUES(?, ?, ?)\");\r\n        $query-&gt;bind_param(\"sss\", $title, $content, $img);\r\n        $result = $query-&gt;execute();\r\n        if (!$result) {\r\n\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n    }\r\n\r\n    public function getarticle($articleid)\r\n    {\r\n        $con = $this-&gt;db-&gt;OpenCon();\r\n\r\n        $stmt = \"SELECT article_name,article_content,img,date from post WHERE article_id = '$articleid'\";\r\n\r\n        $result = $con-&gt;query($stmt);\r\n\r\n        if ($result-&gt;num_rows == 1) {\r\n            $sql = $result;\r\n        } else {\r\n            $sql = \"No article\";\r\n        }\r\n\r\n        $this-&gt;db-&gt;CloseCon();\r\n\r\n        return $sql;\r\n\r\n    }\r\n\r\n    public function deletearticle($id)\r\n    {\r\n\r\n        $con    = $this-&gt;db-&gt;OpenCon();\r\n        $sql    = \"DELETE FROM post WHERE article_id = '$id'\";\r\n        $result = $con-&gt;query($sql);\r\n\r\n        if (!$result) {\r\n\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n    }\r\n\r\n    public function updatearticle($a_id, $a_content, $a_name, $a_image)\r\n    {\r\n\r\n        $con     = $this-&gt;db-&gt;OpenCon();\r\n        $title   = $con-&gt;real_escape_string($a_name);\r\n        $content = $con-&gt;real_escape_string($a_content);\r\n        $img     = $con-&gt;real_escape_string($imgname);\r\n        $query   = $con-&gt;prepare(\"UPDATE post SET article_name = ? , article_content = ?, img = ? WHERE article_id = ?\");\r\n        $query-&gt;bind_param(\"sssi\", $title, $content, $img, $a_id);\r\n        $result = $query-&gt;execute();\r\n        if (!$result) {\r\n            $error = $con-&gt;error;\r\n\r\n            $this-&gt;db-&gt;CloseCon();\r\n            return $error;\r\n        }\r\n        $result = true;\r\n        return $result;\r\n\r\n    }\r\n}<\/pre>\n<h2>Conclusion:<\/h2>\n<p>In this part of the tutorial, I have introduced the code of the class that handles all the CRUD requests. In the next part, I will use this class to Insert, read, update and delete posts. Till then goodbye.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a default option. For many new developers, the functionality of the blogs remains a mystery. Blogs have become so tightly integrated with the overall structure of the CMS (especially WP, &hellip;<\/p>\n","protected":false},"author":174,"featured_media":930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[381],"class_list":["post-13923","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-mysql"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a\" \/>\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.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/ahmedkhannn\" \/>\n<meta property=\"article:published_time\" content=\"2016-07-13T17:31:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ahmed Khan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ahmed0627\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ahmed Khan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\"},\"author\":{\"name\":\"Ahmed Khan\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/39826783730ea673ddc3383fe3bcf855\"},\"headline\":\"Creating a complete blog (CRUD) using MySQL and PHP\",\"datePublished\":\"2016-07-13T17:31:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\"},\"wordCount\":515,\"commentCount\":8,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"keywords\":[\"MySQL\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\",\"name\":\"Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"datePublished\":\"2016-07-13T17:31:10+00:00\",\"description\":\"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/php\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Creating a complete blog (CRUD) using MySQL and PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/39826783730ea673ddc3383fe3bcf855\",\"name\":\"Ahmed Khan\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9c0240c8a389a58b007699e24a2d7e937f6d150934678d723fb7037e3e5d5d56?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9c0240c8a389a58b007699e24a2d7e937f6d150934678d723fb7037e3e5d5d56?s=96&d=mm&r=g\",\"caption\":\"Ahmed Khan\"},\"description\":\"Ahmed Khan is the PHP Community Manager at Cloudways, a hosting company that specializes in optimized PHP hosting services. He writes about PHP, MySQL and covers different tips and tricks related to PHP. He is currently active on Cloudways and other different blogs. When he is not writing about PHP, he likes watching The Flash, Game Of Thrones and is a die-hard fan of DC Comics.\",\"sameAs\":[\"https:\/\/www.facebook.com\/ahmedkhannn\",\"https:\/\/x.com\/ahmed0627\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/ahmed-khan\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026","description":"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a","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.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/","og_locale":"en_US","og_type":"article","og_title":"Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026","og_description":"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a","og_url":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_author":"https:\/\/www.facebook.com\/ahmedkhannn","article_published_time":"2016-07-13T17:31:10+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","type":"image\/jpeg"}],"author":"Ahmed Khan","twitter_card":"summary_large_image","twitter_creator":"@ahmed0627","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Ahmed Khan","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/"},"author":{"name":"Ahmed Khan","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/39826783730ea673ddc3383fe3bcf855"},"headline":"Creating a complete blog (CRUD) using MySQL and PHP","datePublished":"2016-07-13T17:31:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/"},"wordCount":515,"commentCount":8,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","keywords":["MySQL"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/","url":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/","name":"Creating a complete blog (CRUD) using MySQL and PHP - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","datePublished":"2016-07-13T17:31:10+00:00","description":"Blogs have become an essential component of \u00a0corporate websites. This is why every major and minor CMS now offer an integrated or independent blog as a","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/php\/creating-complete-blog-crud-using-mysql-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"PHP","item":"https:\/\/www.webcodegeeks.com\/category\/php\/"},{"@type":"ListItem","position":3,"name":"Creating a complete blog (CRUD) using MySQL and PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/39826783730ea673ddc3383fe3bcf855","name":"Ahmed Khan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9c0240c8a389a58b007699e24a2d7e937f6d150934678d723fb7037e3e5d5d56?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9c0240c8a389a58b007699e24a2d7e937f6d150934678d723fb7037e3e5d5d56?s=96&d=mm&r=g","caption":"Ahmed Khan"},"description":"Ahmed Khan is the PHP Community Manager at Cloudways, a hosting company that specializes in optimized PHP hosting services. He writes about PHP, MySQL and covers different tips and tricks related to PHP. He is currently active on Cloudways and other different blogs. When he is not writing about PHP, he likes watching The Flash, Game Of Thrones and is a die-hard fan of DC Comics.","sameAs":["https:\/\/www.facebook.com\/ahmedkhannn","https:\/\/x.com\/ahmed0627"],"url":"https:\/\/www.webcodegeeks.com\/author\/ahmed-khan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/13923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/174"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=13923"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/13923\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/930"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=13923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=13923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=13923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}