{"id":46629,"date":"2021-02-03T00:00:00","date_gmt":"2021-02-03T08:00:00","guid":{"rendered":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/blog\/data-collection-with-griddb-and-php\/"},"modified":"2025-11-13T12:55:09","modified_gmt":"2025-11-13T20:55:09","slug":"data-collection-with-griddb-and-php","status":"publish","type":"post","link":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/blog\/data-collection-with-griddb-and-php\/","title":{"rendered":"Data Collection with GridDB and PHP"},"content":{"rendered":"<p>Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can effectively perform a data collection task with PHP and GridDB. Let\u00e2\u20ac\u2122s discuss a situation where we need to collect data through a simple web application. First of all let\u00e2\u20ac\u2122s make the scenario clear.<\/p>\n<h2> The scenario <\/h2>\n<p>There is a project about human nutritions that requires collecting data related to the breakfast, lunch and dinner of selected people. Every person has an ID for unique identification and they are required to log the details such as ID, type of meal and foods included in the meal to a web based form right before having each meal. Since this application automatically captures the submitted timestamp, the users don\u00e2\u20ac\u2122t have to add the time explicitly. Moreover, this application consists of a simple HTML form with a PHP backend and GridDB database .<\/p>\n<p>The following table will give you a proper idea about what details should be submitted in the form.<\/p>\n<p><a href=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/01\/Screenshot_2.png\"><img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/griddb.net\/wp-content\/uploads\/2021\/01\/Screenshot_2.png\" alt=\"\" width=\"636\" height=\"244\" class=\"aligncenter size-full wp-image-27240\" srcset=\"\/wp-content\/uploads\/2021\/01\/Screenshot_2.png 636w, \/wp-content\/uploads\/2021\/01\/Screenshot_2-300x115.png 300w, \/wp-content\/uploads\/2021\/01\/Screenshot_2-600x230.png 600w\" sizes=\"(max-width: 636px) 100vw, 636px\" \/><\/a><\/p>\n<p>Okay, now let\u00e2\u20ac\u2122s move to the implementation. Implementation mainly will be done in two steps.<\/p>\n<ol>\n<li>Creating HTML form <\/li>\n<li> Developing the PHP backend with GridDB <\/li>\n<\/ol>\n<h2>Creating HTML form <\/h2>\n<p>We need to create a simple HTML form with ID, meal and meal type. user ID and meal details are collected with text boxes and meal type is collected with radio buttons. The complete HTML script can be written as follows. We have used Bootstrap 4 to create this form.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-html\">&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot; \/&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; \/&gt; &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;ie=edge&quot; \/&gt; &lt;title&gt;Static Template&lt;\/title&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/4.0.0\/css\/bootstrap.min.css&quot; integrity=&quot;sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW\/dAiS6JXm&quot; crossorigin=&quot;anonymous&quot; \/&gt; &lt;\/head&gt; &lt;body&gt; &lt;h2 style=&quot;text-align: center;&quot;&gt;Data Collection For Research&lt;\/h2&gt; &lt;form style=&quot;margin: 20px;&quot;&gt; &lt;div class=&quot;form-group&quot;&gt; &lt;label for=&quot;userid&quot;&gt;ID&lt;\/label&gt; &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;userid&quot; aria-describedby=&quot;userid&quot; placeholder=&quot;Enter Your ID&quot; \/&gt; &lt;small id=&quot;userid&quot; class=&quot;form-text text-muted&quot; &gt;Please enter the unique ID that given by the organization.&lt;\/small &gt; &lt;\/div&gt; &lt;div class=&quot;form-group&quot;&gt; &lt;label for=&quot;mealtype&quot;&gt;Meal Type&lt;\/label&gt; &lt;br \/&gt; &lt;div class=&quot;form-check form-check-inline&quot; is=&quot;mealtype&quot;&gt; &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;breakfast&quot; id=&quot;breakfast&quot; value=&quot;breakfast&quot; \/&gt; &lt;label class=&quot;form-check-label&quot; for=&quot;breakfast&quot;&gt;Breakfast&lt;\/label&gt; &lt;\/div&gt; &lt;div class=&quot;form-check form-check-inline&quot;&gt; &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;lunch&quot; id=&quot;lunch&quot; value=&quot;lunch&quot; \/&gt; &lt;label class=&quot;form-check-label&quot; for=&quot;lunch&quot;&gt;Lunch&lt;\/label&gt; &lt;\/div&gt; &lt;div class=&quot;form-check form-check-inline&quot;&gt; &lt;input class=&quot;form-check-input&quot; type=&quot;radio&quot; name=&quot;dinner&quot; id=&quot;dinner&quot; value=&quot;dinner&quot; \/&gt; &lt;label class=&quot;form-check-label&quot; for=&quot;dinner&quot;&gt;Dinner&lt;\/label&gt; &lt;\/div&gt; &lt;\/div&gt; &lt;div class=&quot;form-group&quot;&gt; &lt;label for=&quot;meal&quot;&gt;Meal&lt;\/label&gt; &lt;input type=&quot;text&quot; class=&quot;form-control&quot; id=&quot;meal&quot; aria-describedby=&quot;meal&quot; placeholder=&quot;Enter Your Main meal&quot; \/&gt; &lt;\/div&gt; &lt;button type=&quot;submit&quot; id=&quot;submitBtn&quot; class= &quot;btn btn-primary&quot;&gt;Submit&lt;\/button&gt; &lt;\/form&gt; &lt;\/body&gt; &lt;\/html&gt;<\/code><\/pre>\n<\/div>\n<p>The output looks like this.<\/p>\n<p><!DOCTYPE html><br \/>\n<html lang=\"en\"><br \/>\n <head><br \/>\n   <meta charset=\"UTF-8\" \/><br \/>\n   <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" \/><br \/>\n   <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" \/><br \/>\n   <title>Static Template<\/title>\n   <link\n     rel=\"stylesheet\"\n     href=\"https:\/\/maxcdn.bootstrapcdn.com\/bootstrap\/4.0.0\/css\/bootstrap.min.css\"\n     integrity=\"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW\/dAiS6JXm\"\n     crossorigin=\"anonymous\"\n   \/><br \/>\n <\/head><br \/>\n <body><\/p>\n<h2 style=\"text-align: center;\">Data Collection For Research<\/h2>\n<form style=\"margin: 20px;\">\n<div class=\"form-group\">\n       <label for=\"userid\">ID<\/label><br \/>\n       <input\n         type=\"text\"\n         class=\"form-control\"\n         id=\"userid\"\n         aria-describedby=\"userid\"\n         placeholder=\"Enter Your ID\"\n       \/><br \/>\n       <small id=\"userid\" class=\"form-text text-muted\"\n         >Please enter the unique ID that given by the organization.<\/small\n       >\n     <\/div>\n<div class=\"form-group\">\n       <label for=\"mealtype\">Meal Type<\/label><br \/>\n       <\/p>\n<div class=\"form-check form-check-inline\" is=\"mealtype\">\n         <input\n           class=\"form-check-input\"\n           type=\"radio\"\n           name=\"breakfast\"\n           id=\"breakfast\"\n           value=\"breakfast\"\n         \/><br \/>\n         <label class=\"form-check-label\" for=\"breakfast\">Breakfast<\/label>\n       <\/div>\n<div class=\"form-check form-check-inline\">\n         <input\n           class=\"form-check-input\"\n           type=\"radio\"\n           name=\"lunch\"\n           id=\"lunch\"\n           value=\"lunch\"\n         \/><br \/>\n         <label class=\"form-check-label\" for=\"lunch\">Lunch<\/label>\n       <\/div>\n<div class=\"form-check form-check-inline\">\n         <input\n           class=\"form-check-input\"\n           type=\"radio\"\n           name=\"dinner\"\n           id=\"dinner\"\n           value=\"dinner\"\n         \/><br \/>\n         <label class=\"form-check-label\" for=\"dinner\">Dinner<\/label>\n       <\/div>\n<\/p><\/div>\n<div class=\"form-group\">\n       <label for=\"meal\">Meal<\/label><br \/>\n       <input\n         type=\"text\"\n         class=\"form-control\"\n         id=\"meal\"\n         aria-describedby=\"meal\"\n         placeholder=\"Enter Your Main meal\"\n       \/>\n     <\/div>\n<p>     <button type=\"submit\" id=\"submitBtn\" class= \"btn btn-primary\">Submit<\/button><br \/>\n   <\/form>\n<p> <\/body><br \/>\n<\/html><\/p>\n<p>Now let\u00e2\u20ac\u2122s move to the second step in our implementation.<\/p>\n<h2>Developing the PHP backend with GridDB<\/h2>\n<p>Now we are done with our front-end part. Next we need to develop the backend with PHP and GridDB. First we need to install and set up the GridDB database connector for PHP. This connector supports PHP version 7 upwards. So you need to use PHP 7 or a higher version for this application.<\/p>\n<p>You can clone the Github repository of the PHP client with the following command.<\/p>\n<p><code>git clone https:\/\/github.com\/griddb\/php_client.git<\/code><\/p>\n<p>You need to build and install the GridDB C client in order to set up the PHP client. You can read <a href=https:\/\/griddb.net\/en\/blog\/using-griddbs-cpythonruby-apis\/#c-intro\">this<\/a> blog to have a clear idea on how to install and set up the GridDB C client. After that, it\u00e2\u20ac\u2122s required to follow the instructions in the README page of the <a href=\"https:\/\/github.com\/griddb\/php_client\">PHP client github page<\/a> to set up the PHP client.<\/p>\n<p>At this point, I assume that you have successfully installed and set up the PHP client following the steps mentioned above. So now let\u00e2\u20ac\u2122s see how we can connect GridDB with the PHP client.<\/p>\n<h2>Connecting GridDB with PHP client<\/h2>\n<p>To connect GridDB with the PHP client, you simply need to include the griddb_php_client. The GridDB package name in PHP is StoreFactory. The code below shows you how to implement the connection.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">?php\n     include('griddb_php_client.php');\n     $factory = StoreFactory::get_default();\n     try {\n        \n         $gridstore = $factory->get_store(array(\"notificationAddress\" => $argv[1],\n                           \"notificationPort\" => $argv[2],\n                           \"clusterName\" => $argv[3],\n                           \"user\" => $argv[4],\n                           \"password\" => $argv[5]\n                       ));\n       } catch(GSException $e){\n           echo($e->what().\"n\");\n           echo($e->get_code().\"n\");\n       }\n    ?<\/code><\/pre>\n<\/div>\n<p>Let\u00e2\u20ac\u2122s discuss what we have done in this code. Here we have initialized a GridDB instance. For that, it\u00e2\u20ac\u2122s required to mention the notification port, the cluster name , username and password. If any non-descriptive error occurs this will give the error and the error code.<\/p>\n<p>Simple, right?<\/p>\n<h2>Creating a container<\/h2>\n<p>By now, we have initialized a gridstore. Now let\u00e2\u20ac\u2122s discuss how we can create a container to store our data. As we discussed in the beginning of this tutorial, there should be 4 attributes in the container as User ID, Meal type, Meal and Timestamp.<\/p>\n<p>In the implementation, we have used put_container method to create the container. The first column must be the timestamp. After creating the schema, we can insert the data as rows to the container.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">$ts = $gridstore->put_container(\"point01\", array(array(\"timestamp\" => GS_TYPE_TIMESTAMP),\n    array(\"userid\" => GS_TYPE_STRING),\n    array(\"mealtype\" => GS_TYPE_STRING)),\n    array(\"meal\" => GS_TYPE_STRING)),\n    GS_CONTAINER_TIME_SERIES);\n<\/code><\/pre>\n<\/div>\n<p>This is how we create schema with required attributes. Please note the types of the attributes. The type of the timestamp attribute is GS_TYPE_TIMESTAMP. We have used GS_TYPE_STRING type for other attributes.<\/p>\n<p>You can use any type such as GS_TYPE_DOUBLE and GS_TYPE_INTEGER based on the attributes you need to have in the database.<\/p>\n<p>Next we are going to create a row object and add data to it. It\u00e2\u20ac\u2122s quite simple to do that. First let\u00e2\u20ac\u2122s check how we can save some hard coded data.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">$row = $ts->create_row();\n        $row->set_field_by_timestamp(0, TimestampUtils::current());\n        $row->set_field_by_string(1, 'GD1001');\n        $row->set_field_by_string(2, 'dinner');\n        $row->set_field_by_string(3, 'hoppers');\n        $ts->put_row($row);\n \n    <\/code><\/pre>\n<\/p><\/div>\n<p>Let\u00e2\u20ac\u2122s see what we have done here. First we created a new row object with create_row method. The important fact is, you should enter all the values to the row in the order that you have created the schema. As you can see in the code, 0,1,2,3 are the column indexes.<\/p>\n<p>Now we know how to insert hard coded data. Next let\u00e2\u20ac\u2122s see how we can insert data which are sent from our html form. For that, we need to check whether the submit button is clicked or not. If it is clicked we can declare some variables and save data which has been sent from the form. Then we can save those data in the database as we did in previous example code.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">if(isset($_POST[\"submitBtn\"]) && $_POST[\"submitBtn\"]!=\"\"){\n        $userid=$_POST[\"userid\"];\n        $mealtype=$_POST[\"mealtype\"];\n        $meal=$_POST[\"meal\"];\n      \n        $row = $ts->create_row();\n        $row->set_field_by_timestamp(0, TimestampUtils::current());\n        $row->set_field_by_string(1, $userid);\n        $row->set_field_by_string(2, $mealtype);\n        $row->set_field_by_string(3, $meal);\n        $ts->put_row($row);  \n    <\/code><\/pre>\n<\/p><\/div>\n<p>So this is how we can save form data in PHP using GridDB. Note that we have used the $_POST method to get data from the form to the current PHP page. As you can see, we have saved all the data in row format.<\/p>\n<p>You don\u00e2\u20ac\u2122t need to input the time that you submit the form. The timestamp automatically gets saved. You can analyse and retrieve data with multiple analysing methods in PHP with GridDB support.<\/p>\n<h2>Query the database <\/h2>\n<p>In this part let\u00e2\u20ac\u2122s briefly talk about how we can query the database and analyze the data according to the requirements.<\/p>\n<p>Suppose that you need to get the details of the meals in all the breakfasts. What can you do? You can simply query the database to get all the related details. For that, we need to create the query as follows.<\/p>\n<p><code>$sql = \"SELECT * FROM point01 WHERE mealtype='breakfast'\";<\/code><\/p>\n<p>Next a row object should be created.<\/p>\n<p><code>$row = $ts->create_row();<\/code><\/p>\n<p>Now we can access all the details required by iterating through all the results we require as follows.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">$rs = $query->fetch($allow_update);\n        while ($rs->has_next()){\n        \n         $rs->get_next($row);\n         $userid = $row->get_field_as_string(1);\n         $meal = $row->get_field_as_string(3);\n          echo(\"UserId = $userid Meal = $meal\");\n        }  \n<\/code><\/pre>\n<\/div>\n<p>Note that we have accessed the required columns with it\u00e2\u20ac\u2122s index that we have initialized previously and these indexes are 0 based.<\/p>\n<p>You see the method <code>get_field_as_string(1)<\/code>. Here, 1 is the 2nd column in the collection. That means it is the UserID.<\/p>\n<p>Cool right?<\/p>\n<p>Now let\u00e2\u20ac\u2122s take a look at another query. Suppose that I need to get all the meal details which are submitted after a specific timestamp. That query will be written as follows.<\/p>\n<p><code>SELECT * FROM point01 WHERE timestamp > 05012019 00:00:00<\/code><\/p>\n<p>Then we can get all the necessary details we need like in the previous example.<\/p>\n<p>However, here we have hard coded the timestamp value. If you need to use the query for multiple timestamps, you can use a function with simple changes to code above.<\/p>\n<div class=\"clipboard\">\n<pre><code class=\"language-php\">function getMeal($timestamp){\n\n        $sql = \"SELECT * FROM point01 WHERE timestamp > $timestamp\";\n        $row = $ts->create_row();\n        $rs = $query->fetch($allow_update);\n       \n        while ($rs->has_next()){\n       \n          $rs->get_next($row);\n          $userid = $row->get_field_as_string(1);\n          $mealtype = $row->get_field_as_string(2);\n          $meal = $row->get_field_as_string(3);\n           echo(\"UserId = $userid Meal = $meal MealType = $mealtype\");\n        }  \n       }       \n<\/code><\/pre>\n<\/div>\n<p>Likewise, you can use any other query to analyze and retrieve data. Try with complex queries that include joins and aggregation methods such as AVG, COUNT etc.<\/p>\n<h2>Summary<\/h2>\n<p>Okay, that\u00e2\u20ac\u2122s pretty much about it. We learned how we can use GridDB with PHP for data collection purposes. Here we used a simple scenario that is useful in many of the researches and systems. The methods and techniques we have used in this article can be used for any related scenarios. It\u00e2\u20ac\u2122s much easier to work with the GridDB PHP client. Considering the many utilities available in it and the time series data support, GridDB is something every PHP developer should know to develop high performance applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can effectively perform a data collection task with PHP and GridDB. Let\u00e2\u20ac\u2122s discuss a situation where we need to collect data through a simple web application. First of all let\u00e2\u20ac\u2122s make [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":25790,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[121],"tags":[],"class_list":["post-46629","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT<\/title>\n<meta name=\"description\" content=\"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"og:description\" content=\"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can\" \/>\n<meta property=\"og:url\" content=\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\" \/>\n<meta property=\"og:site_name\" content=\"GridDB: Open Source Time Series Database for IoT\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/griddbcommunity\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-03T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-13T20:55:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2018\/09\/blog_title_30.png\" \/>\n\t<meta property=\"og:image:width\" content=\"870\" \/>\n\t<meta property=\"og:image:height\" content=\"490\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"griddb-admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:site\" content=\"@GridDBCommunity\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"griddb-admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\"},\"author\":{\"name\":\"griddb-admin\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\"},\"headline\":\"Data Collection with GridDB and PHP\",\"datePublished\":\"2021-02-03T08:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\"},\"wordCount\":389,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2018\/09\/blog_title_30.png\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\",\"url\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\",\"name\":\"Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT\",\"isPartOf\":{\"@id\":\"https:\/\/griddb.net\/en\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage\"},\"thumbnailUrl\":\"\/wp-content\/uploads\/2018\/09\/blog_title_30.png\",\"datePublished\":\"2021-02-03T08:00:00+00:00\",\"dateModified\":\"2025-11-13T20:55:09+00:00\",\"description\":\"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage\",\"url\":\"\/wp-content\/uploads\/2018\/09\/blog_title_30.png\",\"contentUrl\":\"\/wp-content\/uploads\/2018\/09\/blog_title_30.png\",\"width\":870,\"height\":490},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/griddb.net\/en\/#website\",\"url\":\"https:\/\/griddb.net\/en\/\",\"name\":\"GridDB: Open Source Time Series Database for IoT\",\"description\":\"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL\",\"publisher\":{\"@id\":\"https:\/\/griddb.net\/en\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/griddb.net\/en\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/griddb.net\/en\/#organization\",\"name\":\"Fixstars\",\"url\":\"https:\/\/griddb.net\/en\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"contentUrl\":\"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png\",\"width\":200,\"height\":83,\"caption\":\"Fixstars\"},\"image\":{\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/griddbcommunity\/\",\"https:\/\/x.com\/GridDBCommunity\",\"https:\/\/www.linkedin.com\/company\/griddb-by-toshiba\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233\",\"name\":\"griddb-admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g\",\"caption\":\"griddb-admin\"},\"url\":\"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT","description":"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can","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:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/","og_locale":"en_US","og_type":"article","og_title":"Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT","og_description":"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can","og_url":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/","og_site_name":"GridDB: Open Source Time Series Database for IoT","article_publisher":"https:\/\/www.facebook.com\/griddbcommunity\/","article_published_time":"2021-02-03T08:00:00+00:00","article_modified_time":"2025-11-13T20:55:09+00:00","og_image":[{"width":870,"height":490,"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/wp-content\/uploads\/2018\/09\/blog_title_30.png","type":"image\/png"}],"author":"griddb-admin","twitter_card":"summary_large_image","twitter_creator":"@GridDBCommunity","twitter_site":"@GridDBCommunity","twitter_misc":{"Written by":"griddb-admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#article","isPartOf":{"@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/"},"author":{"name":"griddb-admin","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233"},"headline":"Data Collection with GridDB and PHP","datePublished":"2021-02-03T08:00:00+00:00","dateModified":"2025-11-13T20:55:09+00:00","mainEntityOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/"},"wordCount":389,"commentCount":0,"publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2018\/09\/blog_title_30.png","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/","url":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/","name":"Data Collection with GridDB and PHP | GridDB: Open Source Time Series Database for IoT","isPartOf":{"@id":"https:\/\/griddb.net\/en\/#website"},"primaryImageOfPage":{"@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage"},"image":{"@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage"},"thumbnailUrl":"\/wp-content\/uploads\/2018\/09\/blog_title_30.png","datePublished":"2021-02-03T08:00:00+00:00","dateModified":"2025-11-13T20:55:09+00:00","description":"Data collection is a very important phase in the majority of system development projects and researches. In this article, we will discuss how we can","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/blog\/data-collection-with-griddb-and-php\/#primaryimage","url":"\/wp-content\/uploads\/2018\/09\/blog_title_30.png","contentUrl":"\/wp-content\/uploads\/2018\/09\/blog_title_30.png","width":870,"height":490},{"@type":"WebSite","@id":"https:\/\/griddb.net\/en\/#website","url":"https:\/\/griddb.net\/en\/","name":"GridDB: Open Source Time Series Database for IoT","description":"GridDB is an open source time-series database with the performance of NoSQL and convenience of SQL","publisher":{"@id":"https:\/\/griddb.net\/en\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/griddb.net\/en\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/griddb.net\/en\/#organization","name":"Fixstars","url":"https:\/\/griddb.net\/en\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/","url":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","contentUrl":"https:\/\/griddb.net\/wp-content\/uploads\/2019\/04\/fixstars_logo_web_tagline.png","width":200,"height":83,"caption":"Fixstars"},"image":{"@id":"https:\/\/griddb.net\/en\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/griddbcommunity\/","https:\/\/x.com\/GridDBCommunity","https:\/\/www.linkedin.com\/company\/griddb-by-toshiba"]},{"@type":"Person","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/4fe914ca9576878e82f5e8dd3ba52233","name":"griddb-admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/griddb.net\/en\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5bceca1cafc06886a7ba873e2f0a28011a1176c4dea59709f735b63ae30d0342?s=96&d=mm&r=g","caption":"griddb-admin"},"url":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/author\/griddb-admin\/"}]}},"_links":{"self":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46629","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/comments?post=46629"}],"version-history":[{"count":1,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46629\/revisions"}],"predecessor-version":[{"id":51305,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/posts\/46629\/revisions\/51305"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media\/25790"}],"wp:attachment":[{"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/media?parent=46629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/categories?post=46629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/griddb-linux-hte8hndjf8cka8ht.westus-01.azurewebsites.net\/en\/wp-json\/wp\/v2\/tags?post=46629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}