Virtual column in MySQL is generated column, this column data or value comes from expression or function or other columns.
The difference between virtual column and normal column is normal table column value saved to disk
but virtual column value generated dynamically from any expression or function or from other columns.
So the virtual column has following characteristics
Virtual column is
Date: July 22, 2015, 11:11 am Author: Akram Hossain
Yii2 active record has powerful built-in feature to join database table. In this post we will learn some of the useful features
joinWith()
innerJoinWith(),
join()
leftJoin()
join using query builder
Example of joinWith():
$model = Users::find() ->joinWith('posts', false, 'INNER JOIN') ->all();
Example of innerJoinWith():
$mod
Date: July 20, 2015, 3:51 pm Author: Akram Hossain
In this article we will learn how to use Pjax for Yii2 grid view sorting and pagination.
Pjax is a jquery plugin which progressively enhances website page loads and behave more like single-page web application.
We need to these steps to enable Pjax in yii2 web page
Import yii\widgets\Pjax class
Begin Pjax widget using Pjax::begin()
Code block which needs to be rendered using Pjax
Close Pja
Date: July 20, 2015, 3:45 pm Author: Akram Hossain
In this blog post i will discuss about Yii2's pretty URLs.
Yii2 pretty URLs relies on mod_rewrite module on apache or httpd server.
Without Yii2 pretty URLs if you click on any link for example About Us menu,
the URL will be something like http://localhost/hello/web/index.php?r=site/about.
I'd like to change that to http://localhost/hello/web/site/about.
The config subdirectory includes env
Date: July 16, 2015, 12:09 am Author: Akram Hossain
In many cases we need to submit form using jQuery ajax. Yii has built-in support for this funtionality.
In this blog post i will try to cover this topic.
In the view form section at first we need to call form widget
$form = $this->beginWidget('CActiveForm', array( 'id' => 'formId', 'enableAjaxValidation' => false,));
CActiveForm widget accepts multiple parameters, we will use two of
Date: March 3, 2015, 4:21 pm Author: Akram Hossain
In this blog post we will learn how to add jQuery UI date picker to Yii application.
To display jQuery UI date picker in the view page we need to call Yii built-in function widget.
This widget function accepts following parameters
Widget Name
Widget Options
Widget options also accepts multiple parameters it depends on widget class like
Model object
Attribute Name
Options
htmlOption
Date: October 27, 2014, 11:46 am Author: Akram Hossain
In this article we will learn how to load data into yii select box from database.
We will follow below steps
Create a function in model class
Call that function to view page to get the data
Lets say we have a table as pos_mac, now we will add a method named as getMacList() in POS_MAC model class.
This method will load the all table data of pos_mac. Yii CHtml::listData function convert thi
Date: October 16, 2014, 4:03 pm Author: Akram Hossain
In this post we will learn how to connect oracle database using PHP Yii framework.
Following steps we need to follow to accomplish this
Enable php_oci8.dll extension
Restart the apache server
Add connection string
DB username
DB Password
Adding charset(optional)
At first we need to enable php_oci8.dll extension. This extension is used to connect our application to Oracle Database.
We
Date: October 16, 2014, 4:00 pm Author: Akram Hossain
PHP DateTime class provides all the date and time processing functionality.
The DateTimeZone class provides DateTime objects with all the required time zone information.
DateTimeZone require the timezone name as string format and it will return an object representing datetime of that particular time zone.
We need to follow these steps to convert any datetime to particular time zone:
Create a
Date: June 19, 2014, 10:13 pm Author: Akram Hossain
In this tutorial we will learn how to create md5 hash in java. To create md5 hash in java we need follow below steps.
Import java.math.BigInteger.
Import java.security.MessageDigest.
Import java.security.NoSuchAlgorithmException.
Create MessageDigest object for MD5
Update input string in message digest
Converts message digest value in base16 (hex)
If md5 generated successfully return md5
Date: June 18, 2014, 10:40 pm Author: Akram Hossain
For connecting to MySQL database using java we need to do following.
Java driver class name for MySQL: com.mysql.jdbc.Driver
Database connection string or connection url: jdbc:mysql://localhost:3306/addressBook
jdbc is the api name.
mysql is the database managment software.
localhost is the name of server where MySQL is installed.
3306 is the port port number.
addressBook is the name of d
Date: June 18, 2014, 10:37 pm Author: Akram Hossain
In this article i will explain how to export MySQL table data to csv file. To export data to csv at first we need to connect our application to MySQL.
You can follow this tutorial to learn How to connect to MySQL database in java.
We need to follow these steps in order to export data to csv.
Connect to MySQL.
Use FileWriter Class.
Get Data from MySQL table.
Append data to csv file
Flash
Date: June 18, 2014, 10:25 pm Author: Akram Hossain