Thursday, June 25, 2009

Virtual Keyboard

This is the source which i got from other site. But i made some changes which can be useful to you. SO refer it here.


Source is here
And i got it from this site.

designshack

Wednesday, June 24, 2009

Insert distinct rows of table into another Table

Some times you may need to create a table from the other table or just you need the data of another table or another table distinct fields alone you might need.

For that here is simple query which will do your work

INSERT INTO wholegenere(url, name, genr) SELECT distinct(url), name, genr FROM `action`;

create New table example

SQL> CREATE TABLE EMP (EMPNO NUMBER(4) NOT NULL,
2 ENAME VARCHAR2(10),
3 JOB VARCHAR2(9),
4 MGR NUMBER(4),
5 HIREDATE DATE,
6 SAL NUMBER(7, 2),
7 COMM NUMBER(7, 2),
8 DEPTNO NUMBER(2));
SQL>

Inserting data into table

SQL> INSERT INTO EMP VALUES (7369, 'SMITH', 'CLERK', 7902, TO_DATE('17-DEC-1980', 'DD-MON-YYYY'), 800, NULL, 20);
SQL> INSERT INTO EMP VALUES (7499, 'ALLEN', 'SALESMAN', 7698, TO_DATE('20-FEB-1981', 'DD-MON-YYYY'), 1600, 300, 30);
SQL> INSERT INTO EMP VALUES (7521, 'WARD', 'SALESMAN', 7698, TO_DATE('22-FEB-1981', 'DD-MON-YYYY'), 1250, 500, 30);
SQL> INSERT INTO EMP VALUES (7566, 'JONES', 'MANAGER', 7839, TO_DATE('2-APR-1981', 'DD-MON-YYYY'), 2975, NULL, 20);
SQL> INSERT INTO EMP VALUES (7654, 'MARTIN', 'SALESMAN', 7698,TO_DATE('28-SEP-1981', 'DD-MON-YYYY'), 1250, 1400, 30);
SQL> INSERT INTO EMP VALUES (7698, 'BLAKE', 'MANAGER', 7839,TO_DATE('1-MAY-1981', 'DD-MON-YYYY'), 2850, NULL, 30);
SQL> INSERT INTO EMP VALUES (7782, 'CLARK', 'MANAGER', 7839,TO_DATE('9-JUN-1981', 'DD-MON-YYYY'), 2450, NULL, 10);
SQL> INSERT INTO EMP VALUES (7788, 'SCOTT', 'ANALYST', 7566,TO_DATE('09-DEC-1982', 'DD-MON-YYYY'), 3000, NULL, 20);
SQL> INSERT INTO EMP VALUES (7839, 'KING', 'PRESIDENT', NULL,TO_DATE('17-NOV-1981', 'DD-MON-YYYY'), 5000, NULL, 10);
SQL> INSERT INTO EMP VALUES (7844, 'TURNER', 'SALESMAN', 7698,TO_DATE('8-SEP-1981', 'DD-MON-YYYY'), 1500, 0, 30);
SQL> INSERT INTO EMP VALUES (7876, 'ADAMS', 'CLERK', 7788,TO_DATE('12-JAN-1983', 'DD-MON-YYYY'), 1100, NULL, 20);
SQL> INSERT INTO EMP VALUES (7900, 'JAMES', 'CLERK', 7698,TO_DATE('3-DEC-1981', 'DD-MON-YYYY'), 950, NULL, 30);
SQL> INSERT INTO EMP VALUES (7902, 'FORD', 'ANALYST', 7566,TO_DATE('3-DEC-1981', 'DD-MON-YYYY'), 3000, NULL, 20);
SQL> INSERT INTO EMP VALUES (7934, 'MILLER', 'CLERK', 7782,TO_DATE('23-JAN-1982', 'DD-MON-YYYY'), 1300, NULL, 10);
SQL>
SQL>

CREATE Table from another table with consitions

SQL>
SQL> CREATE TABLE newTable AS (SELECT * FROM emp WHERE sal > 2000);
SQL>
SQL> select * from newTable;

EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7566 JONES MANAGER 7839 02-APR-81 2975 20
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7902 FORD ANALYST 7566 03-DEC-81 3000 20
SQL>
SQL> drop table newTable;
SQL>
SQL> drop table emp;

You may need to create a copy of another table.

use this query.

CREATE TABLE new_table AS (SELECT * FROM old_table);

Its all just general sql quries, so you can execute this in Mysql,SQL server, DB2,oracle.

Finding Screen resolution using php and jquery

It will be very usefull when you are working on a project for Multi resolution monitors and the web pages should have same look in all resolutions.

Some others ways also available for this work. But this is best practice and you are going to learn it now.

I know you want to know in a single word how to do it all.

Just you are going to find client monitor resolution from your server and from that you are going to use various style sheets. Got it?

ok fine. Just follow it. In the end you will get source package also.

There are are four files available in the package.

One is index for client system output page - index.php
finder file is for client system resolution finder and store it as session - finder.php

jquery - for ajax (bcz you are going to send request to the server)
trace.js - for to trace monitor resolution and send it to server

and another two style sheets which are going to change the client system page view.

got it.?Yes you might...

Ok now The Source is here
 

About

Hi This is Elamurugan , PHP/AS Web developer from chennai.

Site Info

PHP,MYSQL,AJAX,Action scripting, css,and more tutorials