Category: Database
Moodle | SQL report example in Configurable Reports plugin
SQL Report in ‘Configurable Reports’ plugin provides us an easy UI to write SQL Query and draw results immediately without involving any code complications. Suppose I want to generate my custom grades report based on some specific activities from course
Moodle: Performing search through wildcard queries with ‘Like’ operator
‘Like’ operator of SQL can be used in the following ways in Moodle: Using expression $DB->sql_like: $grade_item_test = $DB->get_records_sql ( ‘SELECT * FROM {grade_items} WHERE ‘.$DB->sql_like(‘idnumber’, ‘:idnum’).’ AND courseid=:cid order by itemmodule’, array (‘idnum’=>’test’,’cid’=> $courseid) ); Using like operator: $grade_item_test
Postgres | JSONB data type field in PostgreSQL(9.4) and using it in CakePHP
JSONB (JSON Blob) datatype in Postgres is used to save JSON data. We can search on JSONB type of column after creating an index on it. For example: Usage in PostgreSQL: 1. Create table and index CREATE TABLE tests (
MySQL Access Denied due to wrong column name
MySQL access Denied for user while Username and password is correct. I got this error when I named one of my table columns as “order” which is also a mysql keyword. When tried to rename it, I got the following
How to create AWS OpsWorks Stack
Purpose is to automate most of recurring processes like creating user, installing application (apache, apache-tomcat, mysql-server …etc), and modifying security file to hardening Linux machines in AWS environment. 1. Click AWS OpsWorks option from AWS console panel: 2. Now click
Configuring AWS WAF (Web Application Firewall)
AWS WAF web application firewall service is built to protect cloud apps from web attacks like DDoS attacks, SQL injections, Cross site scripting. Below are the steps involved in configure AWS WAF security: Step.1 Open CloudFormation and click on create
Couple of different ways to rename table name through UI in phpmyadmin
First method: 1. Click on the database (from list of databases on the phpMyAdmin home screen) in which you want to rename table name. 2. You will see a list of tables on click of the database. 3. Select the
What is PDO? Why PDO should be used in PHP?
PDO stands for PHP Data Objects. PDO is a consistent way to access databases. Today, mostly websites or desktop based applications store their data in databases. Therefore, PHP has also provided the way to connect with databases. PHP supports following
Timestamp issue while upgrading to MySQL 5.7
Problem: In our application, we have created the session token to provide secure access. We were using current system time stamp in our token as one of the key component. But after upgrading MySQL 5.5 to MySQL 5.7, we were