{"id":747,"date":"2017-01-23T00:00:00","date_gmt":"2017-01-23T00:00:00","guid":{"rendered":"http:\/\/blog.hostinger.io\/hostinger-tutorials\/uncategorized\/how-to-use-php-to-insert-data-into-mysql-database\/"},"modified":"2025-12-02T15:42:31","modified_gmt":"2025-12-02T15:42:31","slug":"how-to-use-php-to-insert-data-into-mysql-database","status":"publish","type":"post","link":"\/ca\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","title":{"rendered":"How to use PHP to insert data into MySQL database"},"content":{"rendered":"<p>Managing data within a MySQL database is crucial for web applications and websites. While there are several methods available, one powerful approach is by using PHP to interact with the database. By leveraging the capabilities of MySQLi and PHP Data Objects (PDO) extensions, users can seamlessly insert data into MySQL databases with enhanced security and performance.<\/p><p>In this tutorial, we will show you how to insert data into a MySQL database using PHP scripts and provide you with the necessary knowledge and techniques to effectively utilize PHP for data insertion.<\/p><p class=\"has-text-align-center\"><a href=\"https:\/\/assets.hostinger.com\/content\/Web-Development-Glossary-for-Beginners.pdf\" target=\"_blank\" rel=\"noopener\">Download glossary for web beginners<\/a><\/p><p>\n\n\n\n\n<\/p><h2 class=\"wp-block-heading\" id=\"h-create-a-table-for-the-data\">Create a Table for the Data<\/h2><p>The first step is to create a table for the data. If you have already created one, scroll down to the next section. If not, follow these steps:<\/p><ol class=\"wp-block-list\">\n<li>Open <strong>phpMyAdmin<\/strong> on your hosting control panel.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-full\"><a href=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\"><img loading=\"lazy\" decoding=\"async\" width=\"442\" height=\"298\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/hpanel-databases-phpmyadmin-sidebar.png\" alt=\"The phpMyAdmin button in Databases section in hPanel\" class=\"wp-image-80378\"  sizes=\"auto, (max-width: 442px) 100vw, 442px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"2\">\n<li>Open <strong>u123456789_mydatabase<\/strong> and navigate to the <strong>Create table<\/strong> section.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/The-main-page-of-phpMyAdmin-with-an-empty-website-with-no-table-entries.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"279\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/The-main-page-of-phpMyAdmin-with-an-empty-website-with-no-table-entries-1024x279.png\" alt=\"The main page of phpMyAdmin with an empty website with no table entries\" class=\"wp-image-75428\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"3\">\n<li>Name the table <strong>Students<\/strong> and write <strong>4 <\/strong>in the <strong>Number of columns <\/strong>field. Click the <strong>Go<\/strong> button near the bottom of the page.<\/li>\n\n\n\n<li>A new page will appear. Enter the necessary information for the table.<\/li>\n<\/ol><div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><a href=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/phpMyAdmin-page-while-creating-a-new-table.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"248\" src=\"\/tutorials\/wp-content\/uploads\/sites\/2\/2017\/01\/phpMyAdmin-page-while-creating-a-new-table-1024x248.png\" alt=\"phpMyAdmin page while creating a new table\" class=\"wp-image-75429\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><\/div><ol class=\"wp-block-list\" start=\"5\">\n<li>Click <strong>Save<\/strong> to create a new table.<\/li>\n<\/ol><p>Here are a few explanations of the columns used:<\/p><ul class=\"wp-block-list\">\n<li><strong>Name<\/strong> &ndash; The column name. It will appear at the top of the table.<\/li>\n\n\n\n<li><strong>Type<\/strong> &ndash; The data type. You can set various values, including <strong>int<\/strong>, <strong>varchar<\/strong>, and <strong>string<\/strong>. For example, select <strong>varchar<\/strong> to enter a string type name, which uses letters, not numbers.<\/li>\n\n\n\n<li><strong>Length\/Values<\/strong> &ndash; The maximum entry length for a particular column.<\/li>\n\n\n\n<li><strong>Index<\/strong> &ndash; To enumerate table entries, which is required when configuring table relationships. We recommend always having one ID column when creating a table. We used the <strong>Primary <\/strong>index for our <strong>ID<\/strong> field and marked <strong>A_I<\/strong>, which means <strong>Auto Increment<\/strong>. It automatically lists the entries (1,2,3,4&hellip;).<\/li>\n<\/ul><p>For more information about table structure and its available settings, refer to <a href=\"https:\/\/www.phpmyadmin.net\/docs\/\" target=\"_blank\" rel=\"noreferrer noopener\">phpMyAdmin<\/a>&rsquo;s official documentation.<\/p><h2 class=\"wp-block-heading\" id=\"h-how-to-insert-into-mysql-database-table\">How to Insert Into MySQL Database Table<\/h2><p>There are two methods to <strong>INSERT<\/strong> data into MySQL database &ndash; the PHP MySQLi method and the PHP Data Object (PDO) method.<\/p><h3 class=\"wp-block-heading\" id=\"h-inserting-data-using-mysqli-method\">Inserting Data Using MySQLi Method<\/h3><p>First, establish a connection to a database. When connected, proceed with the <strong>INSERT <\/strong>MySQL query. Here is a full PHP code example with the basic connection and insert methods:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n$servername = \"localhost\";\n$database = \"u123456789_mydatabase\";\n$username = \"u123456789_myuser\";\n$password = \"PasSw0rd123@\";\n\/\/ Create a connection\n$conn = mysqli_connect($servername, $username, $password, $database);\n\/\/ Check the connection\nif (!$conn) {\n     die(\"Connection failed: \" . mysqli_connect_error());\n}\necho \"Connected successfully\";\n$sql = \"INSERT INTO Students (name, lastName, email) VALUES ('Tom', 'Jackson', 'tom@jackson.tld')\";\nif (mysqli_query($conn, $sql)) {\n     echo \"New record created successfully\";\n} else {\n     echo \"Error: \" . $sql . \"&lt;br&gt;\" . mysqli_error($conn);\n}\nmysqli_close($conn);\n?&gt;<\/pre><p><div><p class=\"important\"><strong>Important!<\/strong> If you are setting up a database for remote use, the hosting won&rsquo;t be on the same server as the database. You must set up <a href=\"\/ca\/tutorials\/mysql\/how-to-grant-remote-access-mysql-vps\">remote MySQL access<\/a> first and use its server address instead of <strong>localhost<\/strong>.<\/p><\/div>\n\n\n\n<\/p><p>Lines <strong>2-12 <\/strong>of the code are for the <a href=\"\/ca\/tutorials\/how-to-connect-php-to-mysql\">actual connection to the MySQL database<\/a>. The following<strong> <\/strong>line looks like this:<\/p><pre class=\"wp-block-preformatted\">$sql = \"INSERT INTO Students (name, lastName, email) VALUES ('Tom', 'Jackson', 'tom@jackson.tld')\";<\/pre><p>The <strong>INSERT INTO<\/strong> is a statement that adds data to the specified MySQL database table. In the example above, we are adding data to the table <strong>Students<\/strong>.<\/p><p>Between the parenthesis, the table column names specify where we want to add the values <strong>(name, lastName, email)<\/strong>. The script will add the data in the specified order. If we write <strong>(email, lastName, name)<\/strong>, the script will add the values in the wrong order.<\/p><p>The next part is the <strong>VALUES<\/strong> statement. Here, we specify values in the previously selected columns. Our example would be <strong>name = Tom, lastName = Jackson, email = tom@jackson.tld<\/strong>.<\/p><p>Additionally, users must set SQL queries between quotes. In our example, everything written in quotes after <strong>$sql = <\/strong>is an SQL query.<\/p><p>Meanwhile, lines <strong>14-15 <\/strong>of the code check if the query works and displays a success message:<\/p><pre class=\"wp-block-preformatted\">if (mysqli_query($conn, $sql)) {\n     echo \"New record created successfully\";<\/pre><p>The final part, lines <strong>16-18<\/strong>, displays a different message in case the query fails. It shows an error SQL message instead:<\/p><pre class=\"wp-block-preformatted\">} else {\n\necho \"Error: \" . $sql . \"&lt;br&gt;\" . mysqli_error($conn);\n\n}<\/pre><h3 class=\"wp-block-heading\" id=\"h-inserting-data-using-the-php-data-object-pdo-method\">Inserting Data Using the PHP Data Object (PDO) Method<\/h3><p>To use this method, establish a database connection first by creating a new <strong>PDO object<\/strong>.<\/p><p>Since the connection to the MySQL database is a PDO object, you must use various PDO methods to prepare and run queries.<\/p><p>Methods of objects are called like this:<\/p><pre class=\"wp-block-preformatted\">$the_Object-&gt;the_Method();<\/pre><p>PDO allows users to prepare, evaluate, and correct the SQL code before executing. It can prevent a malicious person from performing a simplified SQL injection attack by typing SQL code into a form.<\/p><p>\/\/ User writes this in the username field of a login form<\/p><pre class=\"wp-block-preformatted\">john\"; DROP DATABASE user_table;\n\/\/ The final query becomes this\n\"SELECT * FROM user_table WHERE username = john\"; DROP DATABASE user_table;<\/pre><p>As a syntactically correct SQL code, the semi-colon makes <strong>DROP DATABASE user_table<\/strong> a new SQL query and deletes the user table. Fortunately, prepared statements do not allow the <strong>&ldquo;<\/strong> and <strong>;<\/strong> characters to end queries. Thus, a malicious instruction to <strong>DROP DATABASE<\/strong> would not work.<\/p><p><div><p class=\"important\"><strong>Important!<\/strong> You should <strong>always<\/strong> use prepared statements when sending or receiving data from the database with PDO. <\/p><\/div>\n\n\n\n<\/p><p>To use prepared statements, you must write a new variable that calls the <strong>prepare()<\/strong> method of the database object. The result will look like this:<\/p><pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;?php\n$servername = \"localhost\";\n$database = \"u123456789_mydatabase\";\n$username = \"u123456789_myuser\";\n$password = \"PasSw0rd123@\";\n$sql = \"mysql:host=$servername;dbname=$database;\";\n$dsn_Options = [PDO::ATTR_ERRMODE =&gt; PDO::ERRMODE_EXCEPTION];\n\/\/ Create a new connection to the MySQL database using PDO, $my_Db_Connection is an object\ntry {\n $my_Db_Connection = new PDO($sql, $username, $password, $dsn_Options);\n echo \"Connected successfully\";\n} catch (PDOException $error) {\n echo 'Connection error: ' . $error-&gt;getMessage();\n}\n\/\/ Set the variables for the person we want to add to the database\n$first_Name = \"Tom\";\n$last_Name = \"Jackson\";\n$email = \"tom@jackson.tld\";\n\/\/ Here we create a variable that calls the prepare() method of the database object\n\/\/ The SQL query you want to run is entered as the parameter, and placeholders are written like this :placeholder_name\n$my_Insert_Statement = $my_Db_Connection-&gt;prepare(\"INSERT INTO Students (name, lastName, email) VALUES (:first_name, :last_name, :email)\");\n\/\/ Now we tell the script which variable each placeholder actually refers to using the bindParam() method\n\/\/ First parameter is the placeholder in the statement above - the second parameter is a variable that it should refer to\n$my_Insert_Statement-&gt;bindParam(\":first_name\", $first_Name);\n$my_Insert_Statement-&gt;bindParam(\":last_name\", $last_Name);\n$my_Insert_Statement-&gt;bindParam(\":email\", $email);\n\/\/ Execute the query using the data we just defined\n\/\/ The execute() method returns TRUE if it is successful and FALSE if it is not, allowing you to write your own messages here\nif ($my_Insert_Statement-&gt;execute()) {\n echo \"New record created successfully\";\n} else {\n echo \"Unable to create record\";\n}\n\/\/ At this point, you can change the data of the variables and execute again to add more data to the database\n$first_Name = \"John\";\n$last_Name = \"Smith\";\n$email = \"john.smith@domain.tld\";\n \n\/\/ Execute again now that the variables have changed\nif ($my_Insert_Statement-&gt;execute()) {\n echo \"New record created successfully\";\n} else {\n echo \"Unable to create record\";\n}<\/pre><p>In lines <strong>24-26<\/strong>, we use the <strong>bindParam()<\/strong> method of the database object. There is also the <strong>bindValue() <\/strong>method, which works differently:<\/p><ul class=\"wp-block-list\">\n<li><strong>bindParam() <\/strong>&ndash; evaluates data when the <strong>execute()<\/strong> method is reached. The first time the script reaches an <strong>execute()<\/strong> method, it sees that <strong>$first_Name<\/strong> corresponds to &ldquo;Tom&rdquo;, binds that value, and runs the query. When the script reaches the second <strong>execute()<\/strong> method, it sees that <strong>$first_Name<\/strong> now corresponds to &ldquo;John&rdquo;, binds that value, and reruns the query with the new values. Note that we defined the query once and reused it with different data at different points in the script.<\/li>\n\n\n\n<li><strong>bindValue() <\/strong>&ndash; evaluates the data as soon as <strong>bindValue()<\/strong> is reached. Since the value of <strong>$first_Name<\/strong> was set to &ldquo;Tom&rdquo; when the <strong>bindValue()<\/strong> was reached, it will be used every time an<strong> execute()<\/strong> method is called for <strong>$my_Insert_Statement<\/strong>.<\/li>\n<\/ul><p>Notice that we reuse the <strong>$first_Name<\/strong> variable and assign it a new value the second time. If you check your database after running this script, you have both defined names, despite the <strong>$first_Name<\/strong> variable equalling &ldquo;John&rdquo; at the end of the script.<\/p><p>The <strong>bindParam<\/strong> method accepts parameters by reference, not by value. Users only need to call <strong>bindParam<\/strong> once, and the script will insert updated values into the database.<\/p><p>You can read more about passing parameters in the PHP <a href=\"https:\/\/www.php.net\/manual\/en\/language.references.pass.php\" target=\"_blank\" rel=\"noreferrer noopener\">manual<\/a>.<\/p><h3 class=\"wp-block-heading\" id=\"h-confirming-the-success\">Confirming the Success<\/h3><p>If the query that we ran and <strong>INSERT<\/strong> into MySQL database was successful, we would see the following message:<\/p><pre class=\"wp-block-preformatted\">Connected Successfully<\/pre><pre class=\"wp-block-preformatted\">New record created successfully<\/pre><h3 class=\"wp-block-heading\" id=\"h-troubleshooting-common-errors\">Troubleshooting Common Errors<\/h3><p>Sometimes, the new record will show an error with the SQL insert. Luckily, there are ways to fix these MySQL errors.<\/p><p><strong>MySQLi<\/strong><\/p><p>If a MySQLi error message appears, we can attempt various fixes.<\/p><p>For example, if we have one syntax error in our code, we will see the following error:<\/p><pre class=\"wp-block-preformatted\">Connect successfully\n\nError: INSERT INTO students {name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld')\n\nYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld')' at line 1\"<\/pre><p>As you can see, the first part of the code is good and the script established the connection successfully. However, the SQL query failed.<\/p><pre class=\"wp-block-preformatted\">\"Error: INSERT INTO Students {name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld') You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '{name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld')' at line 1\"<\/pre><p>This is because a syntax error caused the script to fail. The error was here:<\/p><pre class=\"wp-block-preformatted\">$sql = \"INSERT INTO Students {name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld')\";<\/pre><p>We incorrectly used curly brackets instead of simple parentheses, causing the script to throw a syntax error.<\/p><p><strong>PDO<\/strong><\/p><p>To receive error messages for troubleshooting, the user must set the error mode to <strong>display all exceptions<\/strong>. That&rsquo;s what&rsquo;s written in line <strong>12 <\/strong>of the PDO connection. Since all exceptions are enabled, any specific issue will be displayed.<\/p><p>Users should only use all exceptions when developing a script. It can expose the database and table names, which the user should hide from malicious parties.<\/p><p>In the case above, where curly braces were used instead of parentheses, the error looks similar to this:<\/p><pre class=\"wp-block-preformatted\">Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; &lt;code&gt;check the manual that corresponds to your MySQL server version for the right syntax to use near '{name, lastName, email} VALUES ('Tom', 'Jackson', 'tom@jackson.tld')' at line 1\"<\/pre><p><strong>Other Potential Issues:<\/strong><\/p><ul class=\"wp-block-list\">\n<li>Specifying incorrect columns like non-existent columns or a spelling mistake.<\/li>\n\n\n\n<li>One type of value being assigned to another type of column. For example, if we tried to assign the number <strong>47<\/strong> to a <strong>Name<\/strong> column, we would get an error because it is supposed to be a string value. But if we assigned a number between quotes, for example, <strong>&ldquo;47&rdquo;<\/strong>, it would work because our number would be a string to the column.<\/li>\n\n\n\n<li>Accessing remote MySQL database without Remote MySQL set up.<\/li>\n<\/ul><p>All those errors can be easily fixed by following the error message guidelines or checking the error log.<\/p><?xml encoding=\"utf-8\" ?><figure class=\"wp-block-image size-full\"><a class=\"hgr-tutorials-cta hgr-tutorials-cta-web-hosting\" href=\"\/ca\/web-hosting\" target=\"_blank\" rel=\"noreferrer noopener\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" src=\"https:\/\/www.hostinger.com\/tutorials\/wp-content\/uploads\/sites\/2\/2023\/11\/Web-hosting_in-text-banner.png\" alt=\"Hostinger web hosting banner\" class=\"wp-image-98604\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure><h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2><p>PHP programming language allows users to easily add new MySQL database data with a few lines of code.<\/p><p>In this tutorial, we have shown how to use PHP to<strong> <\/strong>insert data into your<strong> <\/strong>MySQL database using MySQLi, <strong>INSERT<\/strong> statement, and PDO. We have also showcased how to troubleshoot common connection errors.<\/p><p>We hope that you found this tutorial useful. If you have any questions, let us know in the comments below.<\/p><p><div class=\"protip\">\n                    <h4 class=\"title\">Learn More About PHP<\/h4>\n                    <p><a href=\"\/ca\/tutorials\/how-to-install-phpbb\">How to Install phpBB on Your Website<\/a><br>\n<a href=\"\/ca\/tutorials\/php-redirect\">How to (Safely) Make A PHP Redirect<\/a><br>\n<a href=\"\/ca\/tutorials\/best-php-framework\">11 Best PHP Frameworks<\/a><br>\n<a href=\"\/ca\/tutorials\/how-to-create-phpinfo-file\">How to Create phpinfo File<\/a><br>\n<a href=\"\/ca\/tutorials\/php-maximum-upload-size\">How to Modify the PHP Max Upload Size<\/a><\/p>\n                <\/div>\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing data within a MySQL database is crucial for web applications and websites. While there are several methods available, one powerful approach is by using PHP to interact with the database. By leveraging the capabilities of MySQLi and PHP Data Objects (PDO) extensions, users can seamlessly insert data into MySQL databases with enhanced security and [&#8230;]<\/p>\n<p><a class=\"btn btn-secondary understrap-read-more-link\" href=\"\/ca\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database\">Read More&#8230;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_title":"How to Use PHP to Insert Into MySQL Database: 2 Easy Methods","rank_math_description":"Learn how to use PHP insert into MySQL using 2 effective methods: 1. Using MySQLi and INSERT INTO statement; 2. Using the PHP Data Object.","rank_math_focus_keyword":"php mysql insert","footnotes":""},"categories":[22701,22699],"tags":[],"class_list":["post-747","post","type-post","status-publish","format-standard","hentry","category-pre-installed-applications","category-vps"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"pt-BR","link":"https:\/\/www.hostinger.com\/br\/tutoriais\/como-inserir-dados-no-mysql-com-php","default":0},{"locale":"fr-FR","link":"https:\/\/www.hostinger.com\/fr\/tutoriels\/inserer-des-donnees-dans-une-table-mysql-php","default":0},{"locale":"es-ES","link":"https:\/\/www.hostinger.com\/es\/tutoriales\/como-usar-php-para-insertar-datos-en-mysql","default":0},{"locale":"id-ID","link":"https:\/\/www.hostinger.com\/id\/tutorial\/cara-input-data-ke-database-dengan-php","default":0},{"locale":"en-UK","link":"https:\/\/www.hostinger.com\/uk\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"en-MY","link":"https:\/\/www.hostinger.com\/my\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"en-PH","link":"https:\/\/www.hostinger.com\/ph\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"es-MX","link":"https:\/\/www.hostinger.com\/mx\/tutoriales\/como-usar-php-para-insertar-datos-en-mysql\/","default":0},{"locale":"es-CO","link":"https:\/\/www.hostinger.com\/co\/tutoriales\/como-usar-php-para-insertar-datos-en-mysql\/","default":0},{"locale":"es-AR","link":"https:\/\/www.hostinger.com\/ar\/tutoriales\/como-usar-php-para-insertar-datos-en-mysql\/","default":0},{"locale":"pt-PT","link":"https:\/\/www.hostinger.com\/pt\/tutoriais\/como-inserir-dados-no-mysql-com-php","default":0},{"locale":"en-IN","link":"https:\/\/www.hostinger.com\/in\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"en-CA","link":"https:\/\/www.hostinger.com\/ca\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"en-AU","link":"https:\/\/www.hostinger.com\/au\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0},{"locale":"en-NG","link":"https:\/\/www.hostinger.com\/ng\/tutorials\/how-to-use-php-to-insert-data-into-mysql-database","default":0}],"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/747","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/comments?post=747"}],"version-history":[{"count":31,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/747\/revisions"}],"predecessor-version":[{"id":140121,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/posts\/747\/revisions\/140121"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/media?parent=747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/categories?post=747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/ca\/tutorials\/wp-json\/wp\/v2\/tags?post=747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}