<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>PHPOnlineSupport - Recent questions tagged database</title>
<link>http://phponlinesupport.com/tag/database</link>
<description>Powered by Portrave Solutions Pvt. Ltd.</description>
<item>
<title>Get the Last Inserted Id Using Laravel Eloquent</title>
<link>http://phponlinesupport.com/374/get-the-last-inserted-id-using-laravel-eloquent</link>
<description>

&lt;p&gt;I'm currently using the below code to insert data in a table:&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;public function saveDetailsCompany()&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $post = Input::All();&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data = new Company;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;nombre = $post['name'];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;direccion = $post['address'];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;telefono = $post['phone'];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;email = $post['email'];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;giro = $post['type'];&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;fecha_registro = date(&quot;Y-m-d H:i:s&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; $data-&amp;gt;fecha_modificacion = date(&quot;Y-m-d H:i:s&quot;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; if ($data-&amp;gt;save()) {&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return Response::json(array('success' =&amp;gt; true), 200);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Courier New,Courier,monospace&quot;&gt;&lt;span style=&quot;font-size:14px&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;I want to return the last ID inserted but I don't know how to get it.&lt;/p&gt;</description>
<category>MySQL</category>
<guid isPermaLink="true">http://phponlinesupport.com/374/get-the-last-inserted-id-using-laravel-eloquent</guid>
<pubDate>Thu, 03 Jun 2021 09:27:09 +0000</pubDate>
</item>
<item>
<title>How to fix repeating data from SQL join?</title>
<link>http://phponlinesupport.com/372/how-to-fix-repeating-data-from-sql-join</link>
<description>

&lt;p&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;I have 2 tables:&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;table1:&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;&lt;span style=&quot;font-size:9px&quot;&gt;| PERSON_ID | GRADE_LEVEL |START_OF_SCHOOL| END_OF_SCHOOL|&lt;/span&gt;
|&lt;span style=&quot;color:var(--highlight-comment)&quot;&gt;------------|---------------|------------------|-----------------|&lt;/span&gt;
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;             | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;9&lt;/span&gt;                | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;08&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;23&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2010&lt;/span&gt;     | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;05&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;28&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2011&lt;/span&gt;    |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;             | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;10&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;08&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;22&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2011&lt;/span&gt;     | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;05&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;26&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2012&lt;/span&gt;    |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;             | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;11&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;08&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;27&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2012&lt;/span&gt;     | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;06&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;01&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2013&lt;/span&gt;    |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;             | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;12&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;08&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;26&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2013&lt;/span&gt;     | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;05&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;31&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2014&lt;/span&gt;    |
&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;table2:&lt;/span&gt;&lt;/p&gt;

&lt;pre&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;&lt;span style=&quot;font-size:10px&quot;&gt;| PERSON_ID | EFFECTIVE_DATE|&lt;/span&gt;
|&lt;span style=&quot;color:var(--highlight-comment)&quot;&gt;--------------|---------------------|&lt;/span&gt;
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;10&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;28&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2010&lt;/span&gt;      |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;10&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;28&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2011&lt;/span&gt;      |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;10&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;28&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2012&lt;/span&gt;      |
| &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;1&lt;/span&gt;              | &lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;10&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;28&lt;/span&gt;/&lt;span style=&quot;color:var(--highlight-namespace)&quot;&gt;2013&lt;/span&gt;      |&lt;/span&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;span style=&quot;font-family:Times New Roman,Times,serif&quot;&gt;&lt;span style=&quot;color:#242729; font-size:15px&quot;&gt;I don't want the EFFECTIVE_DATE or GRADE_LEVEL tied to each of the other rows when the date ranges don't match. I need EFFECTIVE_DATE in the right date range and correct GRADE_LEVEL tied to it.&lt;/span&gt;&lt;/span&gt;
&lt;/pre&gt;

&lt;pre&gt;
&lt;/pre&gt;</description>
<category>MySQL</category>
<guid isPermaLink="true">http://phponlinesupport.com/372/how-to-fix-repeating-data-from-sql-join</guid>
<pubDate>Thu, 03 Jun 2021 08:41:11 +0000</pubDate>
</item>
<item>
<title>Get tables which using [DEFAULT CURRENT_TIMESTAMP] in mysql?</title>
<link>http://phponlinesupport.com/368/get-tables-which-using-default-currenttimestamp-in-mysql</link>
<description>

&lt;pre class=&quot;lang-sql s-code-block hljs&quot; style=&quot;margin-top: 0px; margin-bottom: 0px; padding: 12px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: 1.30769; font-family: var(--ff-mono); font-size: 13px; vertical-align: baseline; box-sizing: inherit; width: auto; max-height: 600px; overflow: auto; background-color: var(--highlight-bg); border-radius: 5px; color: var(--highlight-color); overflow-wrap: normal;&quot;&gt;&lt;span style=&quot;color:#242729; font-family:-apple-system,BlinkMacSystemFont,&amp;quot;Segoe UI&amp;quot;,&amp;quot;Liberation Sans&amp;quot;,sans-serif; font-size:15px; white-space:normal&quot;&gt;Some&amp;nbsp;tables are using&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 2px 4px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: var(--ff-mono); vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); color: rgb(36, 39, 41); border-radius: 3px;&quot;&gt;DEFAULT CURRENT_TIMESTAMP&lt;/code&gt;&lt;span style=&quot;color:#242729; font-family:-apple-system,BlinkMacSystemFont,&amp;quot;Segoe UI&amp;quot;,&amp;quot;Liberation Sans&amp;quot;,sans-serif; font-size:15px; white-space:normal&quot;&gt;&amp;nbsp;for create_time field.&amp;nbsp;&lt;/span&gt;I want to select all my tables which use&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 2px 4px; border: 0px; font-variant-numeric: inherit; font-variant-east-asian: inherit; font-stretch: inherit; line-height: inherit; font-family: var(--ff-mono); vertical-align: baseline; box-sizing: inherit; background-color: var(--black-075); color: rgb(36, 39, 41); border-radius: 3px;&quot;&gt;DEFAULT CURRENT_TIMESTAMP] in mysql&lt;/code&gt;
&lt;/pre&gt;</description>
<category>MySQL</category>
<guid isPermaLink="true">http://phponlinesupport.com/368/get-tables-which-using-default-currenttimestamp-in-mysql</guid>
<pubDate>Wed, 02 Jun 2021 12:21:44 +0000</pubDate>
</item>
<item>
<title>Where is my mongodb database?</title>
<link>http://phponlinesupport.com/303/where-is-my-mongodb-database</link>
<description>After much struggle installing the mongodb and all I created a database from the NodeJs script. It is in hte localhost, my computer. But I cannot find the database I made while I check through the compass. Whats happening?</description>
<category>MongoDB</category>
<guid isPermaLink="true">http://phponlinesupport.com/303/where-is-my-mongodb-database</guid>
<pubDate>Tue, 23 Oct 2018 22:11:38 +0000</pubDate>
</item>
<item>
<title>What database actually FACEBOOK uses?</title>
<link>http://phponlinesupport.com/163/what-database-actually-facebook-uses</link>
<description>


&lt;p&gt;&lt;span style=&quot;color:#073763; font-family:trebuchet ms,sans-serif&quot;&gt;A billion of people are using FACEBOOK.Users are expressing themselves and interacting with their&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:#073763; font-family:trebuchet ms,sans-serif&quot;&gt;peer and friends through wall posts, uploading their photos, passing information&amp;rsquo;s about events and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color:#073763; font-family:trebuchet ms,sans-serif&quot;&gt;other meaningful information and for that reason facebook needs a large scalable database.&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;color:#073763; font-family:trebuchet ms,sans-serif&quot;&gt;I could imagine that is why it is a very popular Google search keyword. &lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style=&quot;color:#073763; font-family:trebuchet ms,sans-serif&quot;&gt;I have searched a lot on this topic and come out at a conclusion that Facebook use several database&amp;nbsp;techniques. The challenge for Facebook&amp;rsquo;s engineers has been to keep the site up and running&amp;nbsp;smoothly in spite of handling close to billion active users.&lt;/span&gt;&lt;/p&gt;
</description>
<category>General</category>
<guid isPermaLink="true">http://phponlinesupport.com/163/what-database-actually-facebook-uses</guid>
<pubDate>Thu, 13 Oct 2016 03:18:56 +0000</pubDate>
</item>
<item>
<title>Database Backup Manager</title>
<link>http://phponlinesupport.com/137/database-backup-manager</link>
<description>Please suggest Database Backup Manager for Laravel</description>
<category>Laravel</category>
<guid isPermaLink="true">http://phponlinesupport.com/137/database-backup-manager</guid>
<pubDate>Tue, 23 Aug 2016 06:18:57 +0000</pubDate>
</item>
<item>
<title>PostgreSQL database module</title>
<link>http://phponlinesupport.com/129/postgresql-database-module</link>
<description>Anyone please suggest a good PostgreSQL database module for Kohana?</description>
<category>Kohana</category>
<guid isPermaLink="true">http://phponlinesupport.com/129/postgresql-database-module</guid>
<pubDate>Tue, 23 Aug 2016 05:54:28 +0000</pubDate>
</item>
</channel>
</rss>