php – DataTables – Dynamic Columns From Ajax Data Source? – Stack Overflow

Source: php – DataTables – Dynamic Columns From Ajax Data Source? – Stack Overflow

Advertisements

pivot sql server

SELECTSELECT R.UserID, R.RoleIDFROM User_Role R;
DECLARE @cols AS NVARCHAR(MAX),    @query  AS NVARCHAR(MAX)
select @cols = STUFF((SELECT DISTINCT ‘,’ + QUOTENAME(RoleID)                     from User_Role                    group by UserID,RoleID            FOR XML PATH(”), TYPE            ).value(‘.’, ‘NVARCHAR(MAX)’)         ,1,1,”)
set @query = ‘SELECT ‘ + @cols + ‘ from              (                select UserID,RoleID                from User_Role            ) x            pivot             (                UserID                for RoleID in (‘ + @cols + ‘)            ) p ‘
execute(@query);
select * from yourtable

Centos 7 , php 5.6 , mysql, vagrant

[root@localhost ~]# history
1  yum install httpd
2  yum search php
3  sudo apachectl restart
4  yum install php56w
5  yum install php56u
6  rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
7  rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
8  yum -y install php56w php56w-opcache
9  yum -y install php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mys                                                                                                                ql php56w-intl php56w-mbstring
10  sudo apachectl restart
11  php -v
12  httpd -v
13  exit
14  cd /home
15  cd/Demo
16  cd Demo
17  ls
18  chmod 644 index.php
19  sudo apachectl restart
20  nano /etc/sysconfig/selinux
21  vim /etc/sysconfig/selinux
22  vi /etc/sysconfig/selinux
23  sestatus
24  setenforce 0
25  sudo apachectl restart
26  exit
27  mysql -v
28  yum remove php56w-mysql
29  yum remove php56w-mysqlnd
30  yum remove php5-mysqlnd
31  yum install php-mysqlnd
32  yum remove php-common
33  yum install php-mysqlnd
34  apachectl restart
35  php -v
36  sudo php -v
37  yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd p                                                                                                                hp56w-devel php56w-intl php56w-mbstring
38  yum remove php
39  yum remove php-mysqlnd
40  yum remove php-common
41  yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd p                                                                                                                hp56w-devel php56w-intl php56w-mbstring
42  y
43  apachectl restart
44  php -v
45  mysql -v
46  yum install php56-mysql
47  yum install php56w-mysql
48  yum install php56w-mysqlnd
49  apachectl restart
50  pecl install xdebug
51  yum install pecl
52  yum install php54w-pear
53  yum install php56w-pear
54  yum install gcc gcc-c++ autoconf automake
55  pecl install Xdebug
56  apachectl restart
57  yum install java-1.7.0-openjdk
58  yum remove java-1.7.0-openjdk
59  apachectl stop
60  exit
61  apachectl restart
62  getenforce
63  setenforce 0
64  getenforce
65  yum -y install mysql-community-server
66  rpm -Uvh http://dev.mysql.com/get/mysql-community-release-el7-5.noarch.rp                                                                                                                m
67  yum -y install mysql-community-server
68  /usr/bin/systemctl enable mysqld
69  /usr/bin/systemctl start mysqld
70  service mysqld restart
71  /usr/bin/mysql_secure_installation
72  firewall-cmd  –reload
73  mysql -u root -p root
74  mysql -u root -p mysql
75  service mysqld restart
76  apachectl restart
77  install php5-mysqlnd
78  yum install php5-mysqlnd
79  yum install php56w-mysqlnd
80  yum install php56w-mysqlnd56
81  yum install php-mysqlnd
82  php -m | grep -i php
83  php -i | grep “php”
84  yum info php-fpm
85  yum info php-
86  yum search php
87  yum search php54w
88  yum install php56w-mysqlnd
89  yum install php56w-mysqlnd –skip-broken
90  apachectl restart
91  yum install php-mysqlnd-5.4.16-23.el7_0.3.x86_64
92  yum install php-mysqlnd-5.6.16-23.el7_0.3.x86_64
93  yum install php56w-mysqlnd-5.6.16-23.el7_0.3.x86_64
94  mysql -v
95  su root
96  exit
97  su root
98  exit
99  history

http://www.techoism.com/how-to-upgrade-php-version-5-4-to-5-6-on-centosrhel/

The PHP Development Team reports the quick accessibility of PHP 5.6.0. This new version accompanies new features, some backward incompatible changes and many enhancements.

logo-php56

Main features include in PHP 5.6.0 :

 

  • Constant scalar expressions.
  • Exponentiation utilizing the ** operator.
  • Function and constant importing with the utilization decisive word.
  • phpdbg as an intuitive coordinated debugger SAPI.
  • GMP questions now bolster operator over-burdening.
  • Document transfers bigger than 2 gigabytes in size are presently acknowledged.
  • First we need to check the current version of PHP. To check the versio of PHP run following command:
    # php -v
    
    PHP 5.4.35 (cli) (built: Nov 14 2014 07:04:10)
    Copyright (c) 1997-2014 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    
  • To upgrade php, first you must include the Webtatic EL yum repository data relating to your CentOS/RHEL variant to yum:For CentOS/RHEL 7:
    # rpm -Uvh https://mirror.webtatic.com/yum/el7/epel-release.rpm
    # rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
    

    For CentOS/RHEL 6:

    # rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    
  • After installing Webtatic yum repository, you have to remove the old version of php-common package. It will also delete it dependencies packages.
    # yum remove php-common
    

    Sample Output:

    Dependencies Resolved
    
    ===================================================================================
     Package             Arch          Version                      Repository    Size
    ===================================================================================
    Removing:
     php-common          x86_64        5.4.39-1.el6.remi            @remi        7.0 M
    Removing for dependencies:
     php                 x86_64        5.4.39-1.el6.remi            @remi        9.1 M
     php-cli             x86_64        5.4.39-1.el6.remi            @remi         12 M
     php-devel           x86_64        5.4.39-1.el6.remi            @remi        8.1 M
     php-gd              x86_64        5.4.39-1.el6.remi            @remi        665 k
     php-ldap            x86_64        5.4.39-1.el6.remi            @remi        119 k
     php-mbstring        x86_64        5.4.39-1.el6.remi            @remi        2.5 M
     php-mcrypt          x86_64        5.4.39-1.el6.remi            @remi         86 k
     php-mysql           x86_64        5.4.39-1.el6.remi            @remi        452 k
     php-pdo             x86_64        5.4.39-1.el6.remi            @remi        348 k
     php-pear            noarch        1:1.9.5-9.el6.remi           @remi        2.0 M
     php-process         x86_64        5.4.39-1.el6.remi            @remi        128 k
     php-snmp            x86_64        5.4.39-1.el6.remi            @remi        107 k
     php-xml             x86_64        5.4.39-1.el6.remi            @remi        626 k
    
    Transaction Summary
    ===================================================================================
    Remove       14 Package(s)
    
    Installed size: 43 M
    
  • Now we install PHP 5.5 using following command:
    # yum install -y php56w php56w-opcache php56w-xml php56w-mcrypt php56w-gd php56w-devel php56w-mysql php56w-intl php56w-mbstring
    
  • After installing PHP 5.6, we need to restart Apache service.
    # /etc/init.d/httpd restart
    
    # php -v
    
    PHP 5.6.8 (cli) (built: Apr 17 2015 22:49:36)
    Copyright (c) 1997-2015 The PHP Group
    Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies
        with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2015, by Zend Technologies
    

 

How to upgrade PHP version 5.4 to 5.5 on CentOS/RHEL

Git command

  • Kéo code master về branch có sẵn (How to merge remote master to local branch)

– Checkout về brach cần merger:

– Run :

git fetch
git rebase origin/master

delete file and push to remote

git commit -a -m "A file was deleted"
git push

 

revert deleted file:

git ls-files -d | xargs git checkout --

 show conflict files

git diff --name-only --diff-filter=U


https://backlogtool.com/git-guide/vn/stepup/stepup1_1.html