Showing entries 161 to 170 of 1121
« 10 Newer Entries | 10 Older Entries »
Displaying posts with tag: PHP (reset)
PHP empty() function use with MySQL NULL

PHP provides a handy function, empty(), that is used to determine whether a variable is empty. Perhaps that is a bit confusing to someone unfamiliar with the empty() function and I can see how. In this blog post, I will cover: what empty() means in PHP, what the empty() function does, and a use case pairing up empty() with the PHP ternary operator conditional construct. Both used in combination with the MySQL NULL value. Continue reading and see examples of empty()

Photo by Debby Hudson on …

[Read more]
PHP MySQL BLOB PDF: Display in Browser

In Use MySQL BLOB column with PHP to store .pdf file, I covered an example of how to store a .pdf file in the actual database table using the MySQL BLOB datatype and PHP. Now that we have .pdf’s stored in the database, how do we display them in the browser? This blog post answers that exact question. Continue reading to see a working example using PHP…

Photo by Ben on Unsplash

Self-Promotion:

If you …

[Read more]
Use MySQL BLOB column with PHP to store .pdf file

Like always I am sharing new things I learn here on my blog. I was recently working on a requirement for a LAMP stack web application reporting dashboard in which I needed to store – and eventually – retrieve a .pdf file. I have read in several places (this fantastic book is a great resource) that a viable option is storing images or documents (.pdf in this case) in the actual database table as opposed to on the server file system. MySQL has the BLOB datatype that can be used to store files such as .pdf, .jpg, .txt, and the like. In this blog post, I cover how I accomplished uploading and storing the actual .pdf file in a BLOB column in MySQL using PHP. Any corrections, tips, pointers, and recommendations for best practices are always welcome. We all learn as we go!!!

Photo by …

[Read more]
MySQL DROP statement using phpMyAdmin

The MySQL DROP statement is one of many powerful DDL commands. Be it ALTER TABLE some_table DROP some_column or DROP some_table, this type of command can drastically change your data landscape because in executing MySQL DROP, you are completely removing objects from the database! If you are using the phpMyAdmin web interface, you can execute the MySQL DROP statement with just a few mouse clicks. Continue reading to see how…

Drops of water.

Self-Promotion:

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

Note: The …

[Read more]
Use phpMyAdmin to change column name and datatype in MySQL

Using the MySQL ALTER TABLE command, you can easily change an existing columns’ name and datatype. With just a few clicks, you can do the same in the phpMyAdmin visual web interface. For many developers, this interface is the one they lean on most while programming so it can’t hurt to know how to do it yourself should you find yourself programming in this environment…

Self-Promotion

If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like!

Suppose we have a table with these 3 columns:

  • id
  • title
  • grade

Our goal is to rename the title column to paper_title and to also change the datatype …

[Read more]
How To Import/Export CSV Data Using MySQLi and PHP 7

This tutorial help to import the csv data into MySQL and export data from MySQL to csv file.The CSV file is used to import and export data for moving/exchange data information between web application.You can use rest api or web application to import/export CSV data. The web application data is stored, accessed and exchanged between […]

The post How To Import/Export CSV Data Using MySQLi and PHP 7 appeared first on Phpflow.com.

Sorting associative arrays in PHP with array_multisort() – New learning

If you write MySQL queries, at some point you are going to have to provide query results in a specific order. To impose any ordering in MySQL (this applies to SQL overall and is not directed only at MySQL), you have to use the ORDER BY clause. Without it, there is no guaranteed order. The database is free to send back query results in any order. As I learn PHP, I make it a point to explore both the MySQL side, along with the PHP side in regards to similar type tasks and the efficiency of each. So far in my PHP journey, I have found that arrays are used quite extensively. In this post, I’ll cover array_multisort() – one of many in-built PHP functions – used for sorting arrays. In the context of the example data for this post, the arrays are populated by an unordered MySQL query. Let’s see one example of how you can establish a sorting order in a PHP …

[Read more]
MySQL 8.0 InnoDB ReplicaSet with WordPress in OCI

Today’s article is again related to WordPress and MySQL 8.0. We will see how we can setup MySQL InnoDB ReplicaSet and configure WordPress to split the load using both MySQL Instances: we will split reads and writes between the Primary and the Secondary member of our ReplicaSet.

This will be the first part of our journey to achieve HA for our WordPress site on OCI and using all MySQL Servers we have deployed. We don’t want to have a server idle just waiting to take over in case of an incident.

MySQL InnoDB ReplicaSet

First some words about MySQL InnoDB ReplicaSet.

The ease of use of

[Read more]
Dynamic Image Gallery Using PHP 7 & MySQLi

This tutorial help to create dynamic image gallery using PHP and MySQL.The image upload and listing is very common functionality for web application.I have already shared Image Crop Functionality In Model Box Using PHP tutorial. I am extending my previous above tutorial and added image listing and gallery functionality.I have also added view image into […]

The post Dynamic Image Gallery Using PHP 7 & MySQLi appeared first on Phpflow.com.

Using OCI to install Moodle with MySQL 8.0

Let’s continue our series of using OCI to install popular Open Source programs with MySQL 8.0. After WordPress, Drupal, it’s not the Moodle’s turn!

This is a request from my Japanese colleague Machiko

We will use two different compute instances:

  • the application server (apache, PHP and Moodle)
  • the database server (MySQL 8.0)

The application server will be reachable from the Internet on port 22 (ssh) and 80 (http). The database server won’t be reachable from outside, we will have to use the application server as jumphost to install the server.

This is an overview of the proposed architecture:

Deploying 2 compute instances

The first step is to install 2 compute instances, one in the Public Subnet and one in the Private Subnet.

We first start with the application server (called myMoodle):

As the second instance will be located …

[Read more]
Showing entries 161 to 170 of 1121
« 10 Newer Entries | 10 Older Entries »