Friday, December 2, 2016

Config PhpMyAdmin to your host site

I bought a web hosting facility from the iPage.com. But their given phpMyAdmin is still ver 2. It gives me a lots of headache specially when i try to create a stored procedure (Delimiter issue) .

So i was create a sub domain under my site, create a folder and upload the newest version of the phpMyAdmin.

Once you upload the phpAdmin, brows the root folder and take a copy of the "config.sample.inc.php" file and rename it to the "config.inc.php"

Then open the file and edit it's
$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ 
in to some value like
$cfg['blowfish_secret'] = 'abc123'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

and then again change the following lines


$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = false;


That's all.

Truncate issue with "foreign key constraint"

if you cannot truncate your MySQL table because of a foreign key constraint, but you should

SET FOREIGN_KEY_CHECKS = 0;
Truncate table XXX;
Truncate table YYY;
SET FOREIGN_KEY_CHECKS = 1; 

Tuesday, August 23, 2016

How to update first character upper case in Oracle

select upper(substr(CTY_CITY,1,1))|| substr(CTY_CITY,2,length(CTY_CITY)-1) as Ax from AGM_M_COUNTRY_CITY;

update AGM_M_COUNTRY_CITY
set  CTY_CITY = upper(substr(CTY_CITY,1,1))|| substr(CTY_CITY,2,length(CTY_CITY)-1);

Postgress - Read a XML file from a postgress table XML column

SELECT xmltable.* FROM xmldata, XMLTABLE('//ROWS/ROW' PASSING data COLUMNS id int PATH ...