{"id":4079,"date":"2019-04-04T16:55:01","date_gmt":"2019-04-04T11:25:01","guid":{"rendered":"https:\/\/blog.pheonixsolutions.com\/?p=4079"},"modified":"2019-04-04T17:20:34","modified_gmt":"2019-04-04T11:50:34","slug":"codeigniter-queries","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/","title":{"rendered":"CodeIgniter Queries"},"content":{"rendered":"\n<h4 class=\"wp-block-heading\">CodeIgniter Queries<\/h4>\n\n\n\n<h4 class=\"wp-block-heading\">DATE POSTED: 03\/04\/2019<\/h4>\n\n\n\n<p>In this post we will explain basic CodeIgniter Queries. <br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is CodeIgniter?<\/h2>\n\n\n\n<p>CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications.<\/p>\n\n\n\n<p>Today we are going to discuss about the following query.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li> Select Query <\/li><li> Insert Query<\/li><li> Update Query<\/li><li> Delete Query<\/li><li> Join Query<\/li><\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Select Query <\/h2>\n\n\n\n<p>CodeIgniter Select Query will run using following functions. They are<\/p>\n\n\n\n<h2>$this-&gt;db-&gt;query()<\/h2>\n\n\n\n<p>To execute a query, use the following function:<br>   <\/p>\n\n\n\n<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=\"\">$this->db->query('QUERY HERE');\n$query = $this->db->query(\"select * from user\");\n\/\/SELECT `name` FROM ('user')\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;query() With Query Bindings<\/h4>\n\n\n\n<p>Use Of Query Bindings Benefit of using binds is that the values are automatically escaped, producing safer queries<\/p>\n\n\n\n<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=\"\">$sql = \"SELECT * FROM user WHERE name = ? AND type = ?\"; \n$this->db->query($sql, array('code', 'php'));\n\/\/SELECT * FROM user WHERE name = 'code' AND type = 'php'<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-function\">$this-&gt;db-&gt;get()<\/h4>\n\n\n\n<p>Runs the selection query and returns the result. Can be used by itself to retrieve all&nbsp;<strong>record<\/strong>s from a table:<\/p>\n\n\n\n<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=\"\">$query = $this-> db-> get('users'); \n\/\/SELECT * FROM user\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() Select The Fields<\/h4>\n\n\n\n<p>You can use get the particular column or all the column using this function.<\/p>\n\n\n\n<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=\"\">Type 1: \n\n$this->db->select('name'); \n$query = $this-> db-> get('user'); \n\/\/SELECT name FROM user\n\nType 2:\n\n$this->db->select('name')->from('tbl_user')->get();\n\/\/SELECT `name` FROM ('user')\n\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() With Limit<\/h4>\n\n\n\n<p>The limit keyword is used to limit the number of rows returned in a &nbsp;query result. &nbsp;<br><\/p>\n\n\n\n<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=\"\">Type 1:\n\n$limit=10;\n$query = $this-> db-> get('user',$limit); \n\/\/select * from tbl_user limit 10;\n\n\nType 2:\n\n$this->db->select('id, name');\n$this->db->from('tbl_user');\n$this->db->limit(1);\n$query = $this-> db-> get();\n\/\/select id,name from tbl_user limit 1;\n\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() With Offset,Limit<\/h4>\n\n\n\n<p>The&nbsp;<strong>OFF SET<\/strong>&nbsp;value is also most often used together with the LIMIT keyword. The OFF SET value allows us to specify which row to start from retrieving data<\/p>\n\n\n\n<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=\"\">$limit\t=10;\n$offset\t=20;\n$query = $this-> db-> get('user',$offset,$limit); \n\/\/\/select * from user limit 10, 20\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-select-from\">$this-&gt;db-&gt;get() With select, from<\/h4>\n\n\n\n<p>You can specify the table name in from(), you call the get() function without a parameter.<\/p>\n\n\n\n<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=\"\">$this->db->select('id, name');\n$this->db->from('user');\n$query = $this->db->get();\n\/\/SELECT `id`, `name` FROM (`user`) LIMIT 10, 20;\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get_where()<\/h4>\n\n\n\n<p>Identical to the above function except that it permits you to add a &#8220;where&#8221; clause in the second parameter, instead of using the db-&gt;where() function:<br><\/p>\n\n\n\n<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=\"\">$options=array('usertype'=>'admin');\n$query =  $this->db->get_where('user',$options);\n\/\/SELECT * FROM `an_introduction` WHERE usertype = 'admin'<\/pre>\n\n\n\n<p><br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-where\">$this-&gt;db-&gt;get() With Where<\/h4>\n\n\n\n<p>This function  restricts our select <em>query<\/em> result set and condition is the filter to be applied on the results.<\/p>\n\n\n\n<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=\"\">$this->db->select('username');\n$this->db->from('user');\n$this->db->where('userid',1);\n$this->db->where(\"usertype\",\"admin\");\n$query=$this->db->get();\n\/\/SELECT `username` FROM (`user`) WHERE `userid` = 11 AND `usertype` = 'admin'\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-where\">$this-&gt;db-&gt;get() With Or_Where,<\/h4>\n\n\n\n<p>Generates a WHERE field IN (&#8216;item&#8217;, &#8216;item&#8217;) SQL query joined with OR if appropriate<\/p>\n\n\n\n<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=\"\">$this->db->from('user');\n$this->db->where('username !=', 'xxx');\n$this->db->or_where('userid >', 11); \n$query=$this->db->get();\n\/\/SELECT * FROM (`user`) WHERE username != 'xxx' OR userid > 11\n\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-where\">$this-&gt;db-&gt;get()&nbsp; with Where_In<\/h4>\n\n\n\n<p>Generates a WHERE field IN (&#8216;item&#8217;, &#8216;item&#8217;) SQL query joined with AND if appropriate<\/p>\n\n\n\n<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=\"\">$names = array('name1', 'name2', 'name3');\n$this->db->from('user');\n$this->db->where('status !=', 'active');\n$this->db->or_where_in('username', $names);\n$query=$this->db->get();\n\/\/SELECT * FROM (`user`) WHERE status='active' OR username IN ('name1', 'name2', 'name3')\n\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"get-where\">$this-&gt;db-&gt;get()&nbsp; with or_where_in<\/h3>\n\n\n\n<p>Generates a WHERE field IN (&#8216;item&#8217;, &#8216;item&#8217;) SQL query joined with OR if appropriate<\/p>\n\n\n\n<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=\"\">$names = array('name1', 'name2', 'name3');\n$this->db->from('user');\n$this->db->where('status !=', 'active');\n$this->db->or_where_in('username', $names);\n$query=$this->db->get();\n\/\/SELECT * FROM (`user`) WHERE status='active' OR username IN ('name1', 'name2', 'name3')\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_104\">$this-&gt;db-&gt;get()&nbsp; with where_not_in<\/h4>\n\n\n\n<p>Generates a WHERE field NOT IN (&#8216;item&#8217;, &#8216;item&#8217;) SQL query joined with AND if appropriate<\/p>\n\n\n\n<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=\"\">$names = array('name1', 'name2', 'name3');\n$this->db->from('user');\n$this->db->where('type', $type);\n$this->db->where_not_in('username', $names);\n$query=$this->db->get();\n\/\/SELECT * FROM (`user`) WHERE `type` = 1 AND username NOT IN ('name1', 'name2', 'name3')\n\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db with or_where_not_in<\/h4>\n\n\n\n<p>Generates a WHERE field NOT IN (&#8216;item&#8217;, &#8216;item&#8217;) SQL query joined with OR if appropriate<\/p>\n\n\n\n<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=\"\">$names = array('Frank', 'Todd', 'James');\n$this->db->from('user');\n$this->db->where('type', $type);\n$this->db->or_where_not_in('username', $names);\n$query=$this->db->get();\n\n\/\/SELECT * FROM `an_introduction` WHERE `type` = 1 OR `type` NOT IN('Frank', 'Todd', 'James')\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-like\">$this-&gt;db-&gt;get() With Like<\/h4>\n\n\n\n<p>This function enables you to generate&nbsp;<strong>LIKE<\/strong>&nbsp;clauses, useful for doing searches.<\/p>\n\n\n\n<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=\"\">$this->db->select('username');\n$this->db->from('user');\n$this->db->like(\"username\",\"code\");\n$query=$this->db->get();\n\/\/SELECT `username` FROM (`user`) WHERE `username` LIKE '%code%'\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"mce_127\">$this-&gt;db-&gt;get() With or Like<\/h4>\n\n\n\n<p>This function is identical to the one above, except that multiple instances are joined by OR:<\/p>\n\n\n\n<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=\"\">$this->db->select('username,userid');\n$this->db->from('user');\n$this->db->like('username','code');\n$this->db->or_like('usertype','admin');\n$query=$this->db->get();\n\/\/SELECT `username`, `userid` FROM (`user`) WHERE `username` LIKE '%code%' OR `usertype` LIKE '%admin%'\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() With not_like();<\/h4>\n\n\n\n<p>This function is identical to&nbsp;<strong>like()<\/strong>, except that it generates NOT LIKE statements:<\/p>\n\n\n\n<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=\"\">$this->db->select('username,userid');\n$this->db->from('user');\n$this->db->not_like('username','code');\n$this->db->or_like('usertype','admin');\n$query=$this->db->get();\n\/\/SELECT `username`, `userid` FROM (`user`) WHERE `username` NOT LIKE '%code%' OR `usertype` LIKE '%admin%'\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() with or_not_like;<\/h4>\n\n\n\n<p>This function is identical to&nbsp;<strong>not_like()<\/strong>, except that multiple instances are joined by OR<\/p>\n\n\n\n<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=\"\">$this->db->select('username,userid');\n$this->db->from('user');\n$this->db->where('status','active');\n$this->db->or_not_like('username','code');\n$query=$this->db->get();\n\/\/SELECT `username`, `userid` FROM (`user`) WHERE `status` = 'active' OR `username` NOT LIKE '%code%'<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-group-by\">$this-&gt;db-&gt;get() With group_by<\/h4>\n\n\n\n<p>Permits you to write the GROUP BY portion of your query:<br><\/p>\n\n\n\n<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=\"\">$this->db->select('*');\n$this->db->from('user');\n$this->db->group_by(\"states\"); \n\/\/SELECT * FROM (`user`) group by states<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"get-having\">$this-&gt;db-&gt;get() With having<\/h4>\n\n\n\n<p>Permits you to write the HAVING portion of your query.<\/p>\n\n\n\n<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=\"\">$this->db->select('*');\n$this->db->from('user');\n$this->db->having(\"states=1\"); \n\/\/SELECT * FROM (`tbl_user`) HAVING states=1<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"get-orderby\">$this-&gt;db-&gt;get() With Order BY<\/h3>\n\n\n\n<p>Lets you set an ORDER BY clause. The first parameter contains the name of the column you would like to order by. The second parameter lets you set the direction of the result. Options are&nbsp;asc&nbsp;or&nbsp;desc, or&nbsp;random.<\/p>\n\n\n\n<p><br><\/p>\n\n\n\n<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=\"\">$this->db->select('username');\n$this->db->from('user');\n$this->db->order_by('username');\n$query=$this->db->get();\n\/\/SELECT `username` FROM (`user`) ORDER BY `username`\n<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;get() With count_all_results<\/h4>\n\n\n\n<p>Permits you to determine the number of rows in a particular Active Record query. Queries will accept Active Record restrictors such as where(), or_where(), like(), or_like(), etc. <\/p>\n\n\n\n<p><br><\/p>\n\n\n\n<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=\"\">echo $this->db->count_all('my_table');<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> Insert Query<br><\/h3>\n\n\n\n<p>CodeIgniter Insert Query will run using following functions. They are<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;insert();<br><br><\/h4>\n\n\n\n<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an&nbsp;<strong>array<\/strong>&nbsp;or an&nbsp;<strong>object<\/strong>&nbsp;to the function. Here is an example using an array:<\/p>\n\n\n\n<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=\"\">$data = array(\n   'title' => 'My title' ,\n   'name' => 'My Name' ,\n   'date' => 'My date'\n);\n\n$this->db->insert('user', $data); \nINSERT INTO user (title, name, date) VALUES ('My title', 'My name', 'My date')<\/pre>\n\n\n\n<p><br><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Insert With Query Bindings<\/h4>\n\n\n\n<p>Benefit of using binds is that the values are automatically escaped, producing safer queries<\/p>\n\n\n\n<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=\"\">$sql = \"insert into user (name, age, groupname)\n        values (?, ?, ?)\";\n$this->db->query($sql,array('codeigniter, 35, 'Group 1'));\n\/\/nsert into user (name, age, groupname) VALUES ('codeigniter, 35, 'Group 1')<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;insert_string()<\/h4>\n\n\n\n<p><strong>Note:<\/strong>&nbsp;Values are automatically escaped, producing safer queries.<\/p>\n\n\n\n<p><br><\/p>\n\n\n\n<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=\"\">$data = array( \n        'name'\t= >  $_POST['name'] , \n        'groupname'= >  $_POST['groupname'], \n        'age'\t= >  $_POST['age'] \n    );\n$this-> db->insert_string('user', $data);<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;insert_batch();<\/h4>\n\n\n\n<p>Generates an insert string based on the data you supply, and runs the query. You can either pass an&nbsp;<strong>array<\/strong>&nbsp;or an&nbsp;<strong>object<\/strong>&nbsp;to the function. Here is an example using an array:<br><\/p>\n\n\n\n<p><ins><br><\/ins><\/p>\n\n\n\n<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=\"\">$data = array(\n            array(\n                'name'\t= >  'name1' , \n                'groupname'= >  'groupname1', \n                'age'\t= >  'age1'\n            ),\n            array(\n                'name'\t= >  'name2' , \n                'groupname'= >  'groupname2', \n                'age'\t= >  'age2'\n            )\n        );\n$this->db->insert_batch('tbl_user', $data); \n\/\/INSERT INTO mytable (name, groupname, age) \n\/\/VALUES ('name1', 'groupname1', 'age1'), ('name2', 'groupname2', 'age2')<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Update Query<\/h3>\n\n\n\n<p>CodeIgniter Update Query will run using following functions. They are<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;update();<\/h4>\n\n\n\n<p>Generates an update string and runs the query based on the data you supply. You can pass an&nbsp;<strong>array<\/strong>&nbsp;or an&nbsp;<strong>object<\/strong> to the function. Here is an example using an array:<\/p>\n\n\n\n<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=\"\">$data = array(\n               'title' => $title,\n               'name' => $name,\n               'date' => $date\n            );\n\n$this->db->where('id', $id);\n$this->db->update('mytable', $data); \n\n\/\/ UPDATE mytable \n\/\/ SET title = '{$title}', name = '{$name}', date = '{$date}'\n\/\/ WHERE id = $id<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;update_batch();<\/h4>\n\n\n\n<p>Generates an update string based on the data you supply, and runs the query. You can either pass an&nbsp;<strong>array<\/strong>&nbsp;or an&nbsp;<strong>object<\/strong>&nbsp;to the function. Here is an example using an array:<\/p>\n\n\n\n<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=\"\">$data = array(\n   array(\n      'title' => 'My title' ,\n      'name' => 'My Name 2' ,\n      'date' => 'My date 2'\n   ),\n   array(\n      'title' => 'Another title' ,\n      'name' => 'Another Name 2' ,\n      'date' => 'Another date 2'\n   )\n);\n\n$this->db->update_batch('mytable', $data, 'title'); \n\n\/\/ Produces: \n\/\/ UPDATE `mytable` SET `name` = CASE\n\/\/ WHEN `title` = 'My title' THEN 'My Name 2'\n\/\/ WHEN `title` = 'Another title' THEN 'Another Name 2'\n\/\/ ELSE `name` END,\n\/\/ `date` = CASE \n\/\/ WHEN `title` = 'My title' THEN 'My date 2'\n\/\/ WHEN `title` = 'Another title' THEN 'Another date 2'\n\/\/ ELSE `date` END\n\/\/ WHERE `title` IN ('My title','Another title')<\/pre>\n\n\n\n<p>The first parameter will contain the table name, the second is an associative array of values, the third parameter is the where key.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">&nbsp;Delete Query<\/h3>\n\n\n\n<p>CodeIgniter Delete Query will run using following functions. They are<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">$this-&gt;db-&gt;delete();<\/h3>\n\n\n\n<p>Generates a delete SQL string and runs the query.<\/p>\n\n\n\n<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=\"\">$this->db->delete('tbl_user', array('id' => $id)); \n\/\/DELETE FROM tbl_user WHERE id = $id\n<\/pre>\n\n\n\n<p>The first parameter is the table name, the second is the where clause. You can also use the&nbsp;where()&nbsp;or&nbsp;or_where()&nbsp;functions instead of passing the data to the second parameter of the function:<\/p>\n\n\n\n<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=\"\">$this->db->where('id', $id);\n$this->db->delete('mytable'); \n\n\/\/ Produces:\n\/\/ DELETE FROM mytable \n\/\/ WHERE id = $id<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;empty_table();<\/h4>\n\n\n\n<p>Generates a delete SQL string and runs the query.<\/p>\n\n\n\n<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=\"\">$this->db->empty_table('tbl_user'); \n\/\/ DELETE FROM tbl_user<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;truncate();<\/h4>\n\n\n\n<p>Generates a truncate SQL string and runs the query<\/p>\n\n\n\n<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=\"\">$this->db->from('tbl_user'); \n$this->db->truncate(); \n(OR)\n$this->db->truncate('tbl_user'); \n\/\/ TRUNCATE table tbl_user;<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Join Query<br><\/h3>\n\n\n\n<p>CodeIgniter Join Query will run using following functions. They are<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">$this-&gt;db-&gt;join()<\/h4>\n\n\n\n<p>Permits you to write the&nbsp;<strong>JOIN<\/strong>&nbsp;portion of your query:<\/p>\n\n\n\n<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=\"\">$this->db->select('*');\n$this->db->from('blogs');\n$this->db->join('comments', 'comments.id = blogs.id');\n$query = $this->db->get();\n\n\/\/ Produces:\n\/\/ SELECT * FROM blogs JOIN comments ON comments.id = blogs.id<\/pre>\n\n\n\n<p>Multiple function calls can be made if you need several&nbsp;<strong>join<\/strong>s in one query.<\/p>\n\n\n\n<p>If you need a specific type of&nbsp;<strong>JOIN<\/strong>&nbsp;you can specify it via the third parameter of the function. Options are: left, right, outer, inner, left outer, and right outer.<\/p>\n\n\n\n<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=\"\">$this->db->join('comments', 'comments.id = blogs.id', 'left');\n\/\/ Produces: LEFT JOIN comments ON comments.id = blogs.id\n<\/pre>\n\n\n\n<p>Thanks for using pheonix solutions.<\/p>\n\n\n\n<p>You find this tutorial helpful? Share with your friends to keep it alive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>CodeIgniter Queries DATE POSTED: 03\/04\/2019 In this post we will explain basic CodeIgniter Queries. What is CodeIgniter? CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. Today we are going to discuss about&hellip; <a href=\"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">CodeIgniter Queries<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[340,221,1],"tags":[605,273],"class_list":{"0":"post-4079","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-codeigniter","7":"category-php","8":"category-uncategorized","9":"tag-codeigniter-framework","10":"tag-php","11":"h-entry","13":"h-as-article"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pheonix Solutions - We Empower Your Business Growth<\/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:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pheonix Solutions - We Empower Your Business Growth\" \/>\n<meta property=\"og:description\" content=\"CodeIgniter Queries DATE POSTED: 03\/04\/2019 In this post we will explain basic CodeIgniter Queries. What is CodeIgniter? CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. Today we are going to discuss about&hellip; Continue Reading CodeIgniter Queries\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/\" \/>\n<meta property=\"og:site_name\" content=\"PHEONIXSOLUTIONS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-04T11:25:01+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-04T11:50:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"3837\" \/>\n\t<meta property=\"og:image:height\" content=\"2540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:site\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\"},\"headline\":\"CodeIgniter Queries\",\"datePublished\":\"2019-04-04T11:25:01+00:00\",\"dateModified\":\"2019-04-04T11:50:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/\"},\"wordCount\":1082,\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"keywords\":[\"CodeIgniter framework\",\"php\"],\"articleSection\":[\"Codeigniter\",\"PHP\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/\",\"name\":\"Pheonix Solutions - We Empower Your Business Growth\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\"},\"datePublished\":\"2019-04-04T11:25:01+00:00\",\"dateModified\":\"2019-04-04T11:50:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/codeigniter-queries\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CodeIgniter Queries\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"name\":\"Pheonix Solutions\",\"description\":\"We Empower Your Business Growth\",\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\",\"name\":\"PheonixSolutions\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"width\":454,\"height\":300,\"caption\":\"PheonixSolutions\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/PheonixSolutions-209942982759387\\\/\",\"https:\\\/\\\/x.com\\\/pheonixsolution\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/blog.pheonixsolutions.com\"],\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pheonix Solutions - We Empower Your Business Growth","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:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/","og_locale":"en_US","og_type":"article","og_title":"Pheonix Solutions - We Empower Your Business Growth","og_description":"CodeIgniter Queries DATE POSTED: 03\/04\/2019 In this post we will explain basic CodeIgniter Queries. What is CodeIgniter? CodeIgniter is a powerful PHP framework with a very small footprint, built for developers who need a simple and elegant toolkit to create full-featured web applications. Today we are going to discuss about&hellip; Continue Reading CodeIgniter Queries","og_url":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/","og_site_name":"PHEONIXSOLUTIONS","article_publisher":"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","article_published_time":"2019-04-04T11:25:01+00:00","article_modified_time":"2019-04-04T11:50:34+00:00","og_image":[{"width":3837,"height":2540,"url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/09\/PX2.png","type":"image\/png"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@pheonixsolution","twitter_site":"@pheonixsolution","twitter_misc":{"Written by":"admin","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/"},"author":{"name":"admin","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503"},"headline":"CodeIgniter Queries","datePublished":"2019-04-04T11:25:01+00:00","dateModified":"2019-04-04T11:50:34+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/"},"wordCount":1082,"publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"keywords":["CodeIgniter framework","php"],"articleSection":["Codeigniter","PHP"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/","url":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/","name":"Pheonix Solutions - We Empower Your Business Growth","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#website"},"datePublished":"2019-04-04T11:25:01+00:00","dateModified":"2019-04-04T11:50:34+00:00","breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/blog\/codeigniter-queries\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CodeIgniter Queries"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/blog\/#website","url":"https:\/\/pheonixsolutions.com\/blog\/","name":"Pheonix Solutions","description":"We Empower Your Business Growth","publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pheonixsolutions.com\/blog\/#organization","name":"PheonixSolutions","url":"https:\/\/pheonixsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","contentUrl":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","width":454,"height":300,"caption":"PheonixSolutions"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","https:\/\/x.com\/pheonixsolution"]},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","caption":"admin"},"sameAs":["http:\/\/blog.pheonixsolutions.com"],"url":"https:\/\/pheonixsolutions.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7F4uM-13N","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=4079"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/4079\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=4079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=4079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=4079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}