<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL Archives - AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</title>
	<atom:link href="https://atcodex.com/tag/mysql/feed/" rel="self" type="application/rss+xml" />
	<link>https://atcodex.com/tag/mysql/</link>
	<description>Achieve financial success without sacrificing well-being! AtCodex provides actionable strategies for managing money, time, and personal growth—all in one place.</description>
	<lastBuildDate>Sat, 28 Aug 2021 17:15:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0</generator>

<image>
	<url>https://atcodex.com/wp-content/uploads/2020/05/cropped-New-Project-1-32x32.png</url>
	<title>MySQL Archives - AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</title>
	<link>https://atcodex.com/tag/mysql/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to send PUSH notification from the website using Google FCM and PHP in chunks</title>
		<link>https://atcodex.com/php/how-to-split-long-data-and-send-it-as-chunks-in-php-mysql/</link>
		
		<dc:creator><![CDATA[atcodex]]></dc:creator>
		<pubDate>Tue, 28 Jul 2020 18:34:53 +0000</pubDate>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[FCM]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PUSH notification]]></category>
		<guid isPermaLink="false">https://atcodex.com/?p=553</guid>

					<description><![CDATA[<p>We have already discussed How to send PUSH notification from the website using Google FCM and PHP you can check that post. But most common problems occur when we have &#8230; </p>
<p>The post <a href="https://atcodex.com/php/how-to-split-long-data-and-send-it-as-chunks-in-php-mysql/">How to send PUSH notification from the website using Google FCM and PHP in chunks</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">We have already discussed <a href="https://atcodex.com/php/how-to-send-push-notification-from-the-website-using-google-fcm-and-php/">How to send PUSH notification from the website using Google FCM and PHP</a> you can check that post.</p>



<p class="wp-block-paragraph">But most common problems occur when we have to send push notification to the thousand of devices. FCM only allows the user to send 1k notification at a time. Then what if we have thousands of users. what if we have to send all of them an instant notification. if you try to send the notification to all the users at once then it won&#8217;t work. </p>



<p class="wp-block-paragraph">In that case, we have to send the data in the chunk to the FCM server. </p>



<p class="wp-block-paragraph">Let&#8217;s suppose we have 10k users and we have to send them a notification, then we will divide 10k users into 10 small array containing 1k users. </p>



<p class="wp-block-paragraph"> In this tutorial, we will explain how you can <strong>send PUSH notification from the website using Google FCM and PHP in chunks</strong>.</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="">  //post data
$notification_text = $_POST['notification_text'];
$title = $_POST['title'];

//you can insert post data into db for record here

$get_device_id = $object->get_device_id(); // get device id from database, i am fetching data using PDO you can use Msqli also(we did not mention the class file here) 

$loop =  count(array_chunk($get_device_id,1000));  // count array chunk 1000
$arrayChunk = array_chunk($get_device_id,1000);   // devide array in 1000 chunk

$device_id = array();
for($i=0; $i&lt;$loop;$i++)
{
    foreach($arrayChunk[$i] as $all_device_id)
    {       
           
                $device_id[] =  $all_device_id->firebase_id;
    }

    $body=$notification_text;
    $customData=$url;

    $json_data = 
        [
            "registration_ids" => $device_id,
            "notification" => [
                "body" => $body,
                "title" => $title,
            ],
            "data" => [
                "extra" => $customData
            ]
        ];

 $data = json_encode($json_data); 

$url = 'https://fcm.googleapis.com/fcm/send';
//api_key in Firebase Console -> Project Settings -> CLOUD MESSAGING -> Server key
$server_key = 'AAAAJqUz63o:APA91bH9dBz6RihgEdvKhi5dXJyqEl234234dfdf25--0ylOoQswedsseWgpbR-AIkn7TVP7nP5kpPFxXJTRaAhv-d_It2vC9ejNhHeXOylo8oUm10yHm5h64yzm_PlsPuR';
//header with content_type api key
$headers = array(
    'Content-Type:application/json',
    'Authorization:key='.$server_key
);
// CURL request to route notification to FCM connection server (provided by Google)
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $result = curl_exec($ch);
    if ($result === FALSE) {
        die('Oops! FCM Send Error: ' . curl_error($ch));
    }
    curl_close($ch);
	unset($device_id); // unset the array value 
}</pre>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">In the above code, you will be able to send data in chunks into the FCM server and can send thousand of notification at once.</p>



<p class="wp-block-paragraph">Sending data in the chunk is useful in many scenarios. Here just because FCM has some limitations,  we are sending the data in chunk. </p>



<p class="wp-block-paragraph">For example, if we are trying to upload and insert all data at once then definitely that process is going to consume lots of memory of server which may sometime down the website, So it&#8217;s always recommend doing the bulk data activity in chunks.</p>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://atcodex.com/php/how-to-split-long-data-and-send-it-as-chunks-in-php-mysql/">How to send PUSH notification from the website using Google FCM and PHP in chunks</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>How to Back Up a MySQL Database in cPanel</title>
		<link>https://atcodex.com/blog/cpanel/how-to-back-up-a-mysql-database-in-cpanel/</link>
		
		<dc:creator><![CDATA[atcodex]]></dc:creator>
		<pubDate>Tue, 30 Jun 2020 06:36:57 +0000</pubDate>
				<category><![CDATA[Cpanel]]></category>
		<category><![CDATA[How To]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[PHPMyAdmin]]></category>
		<guid isPermaLink="false">https://atcodex.com/?p=189</guid>

					<description><![CDATA[<p>Database is a core part of any project so its mandatory to keep it safe and for this, we have to take its backup on time to time. We can &#8230; </p>
<p>The post <a href="https://atcodex.com/blog/cpanel/how-to-back-up-a-mysql-database-in-cpanel/">How to Back Up a MySQL Database in cPanel</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"> Database is a core part of any project so its mandatory to keep it safe and for this, we have to take its backup on time to time. We can easily perform this activity in cPanel to keep our database safe. </p>



<p class="wp-block-paragraph">cPanel gives you options to an export database in SQL, CSV, JSON, PDF, PHP array, text, XML, and in many more formats. Just follow the given steps to export the MySQL database from cPanel.</p>



<p class="wp-block-paragraph">1. Log into your&nbsp;<strong>cPanel</strong>&nbsp;account.</p>



<p class="wp-block-paragraph">2. Scroll down or search &#8220;<strong>phpMyAdmin</strong>&#8221;  and click<strong>.</strong></p>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="893" height="216" src="https://atcodex.com/wp-content/uploads/2020/06/1-14.png" alt="" class="wp-image-326" srcset="https://atcodex.com/wp-content/uploads/2020/06/1-14.png 893w, https://atcodex.com/wp-content/uploads/2020/06/1-14-300x73.png 300w, https://atcodex.com/wp-content/uploads/2020/06/1-14-768x186.png 768w" sizes="(max-width: 893px) 100vw, 893px" /></figure>



<p class="wp-block-paragraph"></p>



<p class="wp-block-paragraph">3. In phpMyAdmin, choose the database you wish to backup from the list in the left side panel.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="693" height="425" src="https://atcodex.com/wp-content/uploads/2020/06/2-12.png" alt="" class="wp-image-327" srcset="https://atcodex.com/wp-content/uploads/2020/06/2-12.png 693w, https://atcodex.com/wp-content/uploads/2020/06/2-12-300x184.png 300w" sizes="(max-width: 693px) 100vw, 693px" /></figure>



<p class="wp-block-paragraph">4. After selection, click on the <strong>Export tab</strong> at top of the page</p>



<p class="wp-block-paragraph">5. In the Export page, select the&nbsp;<strong>Quick Export</strong>&nbsp;option and keep the format as&nbsp;<strong>SQL</strong> and  click on <strong>Go</strong>.</p>



<figure class="wp-block-image size-large is-resized"><img decoding="async" src="https://atcodex.com/wp-content/uploads/2020/06/3-8.png" alt="" class="wp-image-328" width="607" height="427" srcset="https://atcodex.com/wp-content/uploads/2020/06/3-8.png 607w, https://atcodex.com/wp-content/uploads/2020/06/3-8-300x211.png 300w" sizes="(max-width: 607px) 100vw, 607px" /></figure>



<p class="wp-block-paragraph">6. When you click&nbsp;<strong>Go</strong>,  your database backup gets created and downloaded in your local machine. Save it in a safe folder for future use. You can later import it into any database for use.</p>



<p class="wp-block-paragraph">Hope this tutorial will help you. You can also  check <a href="https://atcodex.com/how-to/how-to-import-csv-file-into-phpmyadmin/">How to import CSV file into PHPMyAdmin</a>.</p>
<p>The post <a href="https://atcodex.com/blog/cpanel/how-to-back-up-a-mysql-database-in-cpanel/">How to Back Up a MySQL Database in cPanel</a> appeared first on <a href="https://atcodex.com">AtCodex: Empowering Your Financial Journey &amp; Personal Well-Being</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
