1 Star2 Stars3 Stars4 Stars5 Stars (3 votes, average: 5.00 out of 5)

PHP DATA ENCRYPTION INSERT RETRIEVE MYSQL DATABASE

PHP Data Encryption is important to safety and privacy. In this lesson I am going to show you how to insert and retrieve encrypted data in PHP using a mysql database. Using these methods will make your websites and applications more secure.

PHP DATA ENCRYPTION INSERT RETRIEVE MYSQL DATABASE *

In an earlier PHP Data Encryption lesson I showed you guys how to  use Openssl to encrypt and decrypt your data. In this lesson I will show you how to store it and retrieve it from a MySql Database. Here are the files for you to use for the lesson.

Tip: Click on images to make them larger. If you find anything wrong on this page or need further assistance please comment below or contact me. 🙂

Create Database For Encryption *

Create a database to insert your encrypted data.  Name the datbase “users” in your phpmyadmin dashboard. Then create a table called people. Next, make 4 columns in the table id, name, email, reg_date. Set the name and email fields to TEXT. Do not use varchar because varchar will only give you 255 charectors and you may need more than that for your encrypted code. We will use this database to insert and retrieve the data.

Create A Config File *

You need to create a config file to connect to your database. This will let us insert our encrypted data and retrieve our encrypted data.

Subscribe To My YouTube Channel:

Inserting PHP Encrypted Data *

To insert your PHP Encrypted Data into the database that you created from the information above use this code.

mysqli_query($con,"INSERT INTO people(`name`, `email`)VALUES ('$name','$email')");
echo '<div class="alert alert-success">You entered successfully</div>';

Download all the files here and set them up on your server. Follow the video instructions and if you have any questions feel free to ask them below.

PHP DATA ENCRYPTION INSERT RETRIEVE MYSQL DATABASE was last modified: February 23rd, 2019 by Maximus Mccullough

Please like, share and subscribe.

Advanced Programming Made Easy

I hope you enjoyed the article. If I was able to help you please consider a tip for the content.

One Time Tip

more tips

Reoccuring Tips

Tips

Cool People Share:
PHP DATA ENCRYPTION INSERT RETRIEVE MYSQL DATABASE

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.