<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gennady Gu</title>
    <description>The latest articles on DEV Community by Gennady Gu (@gennady46).</description>
    <link>https://dev.to/gennady46</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2636026%2F63140a4a-1dc1-4066-9dcc-358f6138b876.jpeg</url>
      <title>DEV Community: Gennady Gu</title>
      <link>https://dev.to/gennady46</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gennady46"/>
    <language>en</language>
    <item>
      <title>JavaScript using Node.js and accessing and modifying phpMyAdmin database.</title>
      <dc:creator>Gennady Gu</dc:creator>
      <pubDate>Tue, 31 Dec 2024 03:25:22 +0000</pubDate>
      <link>https://dev.to/gennady46/javascript-using-nodejs-and-accessing-and-modifying-phpmyadmin-database-1ke0</link>
      <guid>https://dev.to/gennady46/javascript-using-nodejs-and-accessing-and-modifying-phpmyadmin-database-1ke0</guid>
      <description>&lt;p&gt;Hi, &lt;/p&gt;

&lt;p&gt;I am new to this, never having done this before.&lt;/p&gt;

&lt;p&gt;To make it brief, I have a visual studio windows form application in C# which requires a licensing feature.&lt;/p&gt;

&lt;p&gt;When the user clicks on the "Buy" button it will open up the website, and after the successful payment it will redirect to a certain webpage URL.&lt;/p&gt;

&lt;p&gt;There I would want to use the JavaScript to do a few tasks.&lt;/p&gt;

&lt;p&gt;Getting PC ID, like PC ID = CPU + Motherboard ID, accessing hardware &lt;/p&gt;

&lt;p&gt;information of the target machine.&lt;/p&gt;

&lt;p&gt;And I saw those things need of a server like Node.js to &lt;/p&gt;

&lt;p&gt;gather hardware information, then pass it to your JavaScript code.&lt;/p&gt;

&lt;p&gt;I saw on google: "If you're running JavaScript on a server-side &lt;/p&gt;

&lt;p&gt;environment like Node.js, you can use the &lt;strong&gt;systeminformation&lt;/strong&gt; library":&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JavaScript&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;`const si = require("systeminformation");&lt;/p&gt;

&lt;p&gt;si.cpu()&lt;br&gt;
  .then((data) =&amp;gt; console.log("CPU:", data.manufacturer, data.brand))&lt;br&gt;
  .catch((error) =&amp;gt; console.error(error));&lt;/p&gt;

&lt;p&gt;si.baseboard()&lt;br&gt;
  .then((data) =&amp;gt; console.log("Motherboard:", data.manufacturer, data.model))&lt;br&gt;
  .catch((error) =&amp;gt; console.error(error));`&lt;/p&gt;

&lt;p&gt;Then generate a random license key for the end user with JavaScript. &lt;/p&gt;

&lt;p&gt;Then adding to a PhpMyAdmin database, which is a database I have to &lt;/p&gt;

&lt;p&gt;create on my PC with phpMyAdmin, like PC ID (CPU + Motherboard), First &lt;/p&gt;

&lt;p&gt;Name, Last Name, email and a license key.&lt;/p&gt;

&lt;p&gt;So that I would be able to download the updated database to my SSD at any &lt;/p&gt;

&lt;p&gt;time.&lt;/p&gt;

&lt;p&gt;Also, maybe emailing automatically a license key to a provided email address.&lt;/p&gt;

&lt;p&gt;In addition, I also would be able to add a new person information manually &lt;/p&gt;

&lt;p&gt;with all its fields if I need to do so. I know that this database has to &lt;/p&gt;

&lt;p&gt;be created to begin with, order to get started and the JavaScript coding &lt;/p&gt;

&lt;p&gt;must be implemented on the web page as well along with Node.js package.&lt;/p&gt;

&lt;p&gt;So, after successful delivery of the license key, my program asks to paste &lt;/p&gt;

&lt;p&gt;into the field the license key. And it needs to be checked whether the key &lt;/p&gt;

&lt;p&gt;is correct format or not and also access the updated database to check if &lt;/p&gt;

&lt;p&gt;the key exists or does not, and if it does the program would be activated.&lt;/p&gt;

&lt;p&gt;I already installed Node.js on my PC and phpMyAdmin as well.&lt;/p&gt;

&lt;p&gt;Can you direct me which code or a package I need for Node.js and &lt;/p&gt;

&lt;p&gt;JavaScript code as well... Thanks so much, waiting for response, &lt;/p&gt;

&lt;p&gt;Gennady&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>programming</category>
      <category>database</category>
      <category>softwaredevelopment</category>
    </item>
  </channel>
</rss>
