Situsnya Wordpress

while scratching my head…

Internet Explorer – jQuery – Prevent AJAX Caching May 16, 2013

Filed under: Uncategorized — Remo @ 7:00 am
Tags: , , , , , , , ,

$.ajaxSetup({ cache: false });

 

source:

http://stackoverflow.com/questions/4303829/how-to-prevent-jquery-ajax-caching-in-internet-explorer

 

First Time with PostgreSQL – Creating Table April 26, 2013

Filed under: Uncategorized — Remo @ 1:40 pm
Tags: , ,

CREATE TABLE “public”.”product”
(
product_id integer NOT NULL,
product_name character varying,
supplier_name character varying,
unit_price integer
)

ALTER TABLE “public”.”product” ADD UNIQUE (“product_id”);
ALTER TABLE “public”.”product” ADD PRIMARY KEY (“product_id”);

 

source:

http://blog.enricostahn.com/2010/06/11/postgresql-add-primary-key-to-an-existing-table.html

 

 

PHP – Enable FileInfo in Windows March 16, 2013

Filed under: Uncategorized — Remo @ 1:23 am
Tags: , ,

1. Add php_fileinfo.dll to the list of enabled extensions 

extension=php_fileinfo.dll

2. Download GNU file package for windows
get it from here: http://gnuwin32.sourceforge.net/downlinks/file-bin-zip.php

Extract the folder from the archive called shared\file which contains 4 magic files (magic, magic.mgc, magic.mime, magic.mime.mgc).

3. Place these 4 files in a known place

4. Add system enviroment variable MAGIC that points to the file called magic. For example if you placed magic files in folder called magic in c:\php that means that the propper path is c:\php\magic\magic

5. If you use IIS restart it and fileinfo is ready for use

5a. If you use apache you will have to restart operating system for the service to acknowledge MAGIC env. variable.

 

source:

http://php.net/manual/en/fileinfo.installation.php

 

MySQL – Add Read-Only User March 14, 2013

Filed under: Uncategorized — Remo @ 12:10 am
Tags: , , ,

CREATE USER ‘tester’@'%’ IDENTIFIED BY ‘password’;

GRANT SELECT ON database.* TO ‘tester’@'%’;

 

 

PostgreSQL – List Column Names March 13, 2013

Filed under: Uncategorized — Remo @ 9:32 am
Tags: , , , , ,

to get list of columns on certain table use this command:

select column_name from INFORMATION_SCHEMA.COLUMNS where table_name = ‘table’;

 

PostgreSQL – Backup Table Only

Filed under: Uncategorized — Remo @ 9:23 am
Tags: , , ,

for version >= 8.4.0:
pg_dump –column-inserts –data-only –table=<table> <database>

for version < 8.4.0:
pg_dump -D -t <table> <database>

 

source:

http://stackoverflow.com/questions/2857989/using-pg-dump-to-only-get-insert-statements-from-one-table-within-database

 

MySQL Describe in PostgreSQL March 11, 2013

Filed under: Uncategorized — Remo @ 5:44 am
Tags: , , , ,

We usually use DESCRIBE command in MySQL to display table structure, in PostgreSQL we use this command:

SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name = ‘table’;

 

source:

http://stackoverflow.com/questions/109325/postgresql-describe-table

 

 
Follow

Get every new post delivered to your Inbox.