Posts

Showing posts from March, 2014

Swap two variables value without using third variable in php?

We can swamp two variable with the use of php function  <?php $a='sagar'; $b='deepak'; list($a,$b) = array($b,$a); echo $a.'-'.$b; ?> deepak-sagar We can swap two variable with the use of XOR method too <?php $a='11111'; $b='22222'; $a = $a ^ $b; $b = $a ^ $b; $a = $a ^ $b; echo $a; echo $b; ?>   We can swap two variable with the use of our logic too <?php $a='11111'; $b='22222'; $a = $a + $b; $b = $a - $b; $a = $a - $b; ?> anther one is here   $a = $a * $b; $b = $a / $b; $a = $a / $b;

How to reverse a string without using php function in php?

How to reverse a string without using function in php <?php error_reporting(NULL); $string = 'This is a reversed string'; $len = 0; do{ $len++; } //$len is the length of string while($string[$len]!=''); for($i=$len-1;$i>=0;$i--){ echo $string[$i]; } ?> gnirts desrever a si sihT

Mysql interview question and answer?

1. Define SQL? Answer : SQL stands for Structured Query Language. SQL is a programming Language designed specially for managing data in Relational Database Management System (RDBMS). 2. What is RDBMS? Explain its features? Answer : A Relational Database Management System (RDBMS) is the most widely used database Management System based on the Relational Database model. Features of RDBMS Stores data in tables. Tables have rows and column. Creation and Retrieval of Table is allowed through SQL. 3. What is Data Mining? Answer : Data Mining is a subcategory of Computer Science which aims at extraction of information from set of data and transform it into Human Readable structure, to be used later. 4. What is an ERD? Answer : ERD stands for Entity Relationship Diagram. Entity Relationship Diagram is the graphical representation of tables, with the relationship between them. 5. What is the difference between Primary Key and Unique Key? Answer : Both