Archive for July, 2013


Jul

12

2013
premjith

PHP Interview Questions

1. What is php? Who found it? PHP (Hyper text Pre Processor) is a server side scripting language commonly used for web applications that allows web developers to create dynamic content that interacts with databases. Rasmus Lerdorf is the founder of php. 2. What is a web page? A web page is a document or information resource that is suitable for the World Wide Web and can be accessed through a web […]

read more

Jul

12

2013
premjith

Basic Schema for a data base

This is only my method not a php standard Creating table user — tbl_user : CREATE TABLE tbl_user ( pk_bint_user_id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY, vchr_name VARCHAR(100), vchr_email VARCHAR(50), vchr_phone VARCHAR(50), vchr_login_name VARCHAR(50), vchr_password VARCHAR(50), chr_gender CHAR, chr_user_type CHAR COMMENT ‘A-Admin, U-User’, chr_status CHAR COMMENT ‘A-Active, B- Block, D-Delete’ ); Creating table files — tbl_files : CREATE TABLE tbl_files ( pk_bint_file_id BIGINT AUTO_INCREMENT NOT NULL PRIMARY KEY, fk_bint_user_id BIGINT, vchr_file_name VARCHAR(100), […]

read more

Jul

12

2013
premjith

PHP Interview Questions – VI

1. What will be the out put of the below code? 1 <!–?php $s = 2; function Test() { echo "s = $s"; } Test(); ?–> Answers : a) 1 b) 2 c) 3 d) No value Explanation : The variable $s have only local scope. In order to reference a global variable from a function the “global” keyword must be used inside the function. 2. What will be the out put […]

read more

Jul

12

2013
premjith

Objected Oriented Programming in PHP

I hope you all know about what is object oriented programming and what is procedure oriented programming. if you know those i can skip that section that what is the difference between object oriented and procedure oriented programming. I hope the following simple example help you to understand more about object oriented programming in php lets go through that…… I’m going to give you a student registration and display the registered users […]

read more

Jul

12

2013
premjith

Write a simple query to get the second largest number of a table column?

Write a simple query to get the second largest number of a table column? There are many ways that we can write this, But the simplest way in mysql is, SELECT * FROM country ORDER BY id DESC LIMIT 1, 1 plus there are some other methods as well, SELECT * FROM country ORDER BY id DESC LIMIT 1 OFFSET 1 select max(id) from country where id not in(select max(id) from country) […]

read more