Monthly Archives: September 2017



  • After submitting the enquiry, you will be contacted by our team.
  • Payilagam Team will get to know about your training needs.
  • They will update you how could they help you.
  • Trainers(IT Professionals) may contact you if you need any clarification.
  • Your contact information will be kept highly confidential & not be shared to 3rd Parties.
Quick Enquiry


1) What do you know about php? 2) Write different comments in php? 3) How to declare constant in php? 4) Write any four magic constants in php? 5) Write any 5 super global variable in php? 6) What is the difference between echo and print? 7) What is the difference between post and get? 8) Why we use request in php? 9) What is timestamp in php? 10) How to create, write, read and delete a file in php? 11) How to check the file in php? 12) How to validate IP address in php? 13) What is the difference between include and require? 14) Calculate the length of “PAYILAGAM”. 15)Extract “YILAG” from “PAYILAGAM”. 16) How to remove “PYM” from “PAYILAGAM”. 17) How to declare a variable in php? 18) What is the difference between print_r and var_dump 19) What is the difference between implode and explode. 20) Array: Length, combine, sort(all sortings with key and values), size, structure, shuffle, push, pop, map, reverse, search, shift, slice, unique, multi_sort, pad, compact. 21) What do you know about session and cookie. 22) How to calculate date in php? 23) How to use a global variable as a local variable. 24) Write a query for create a table in php? ( Go through All MySql queries). 25) How to connect php with mysql server. 26) How to insert a data into mysql database. 27) How to retrieve a data from database in php. 28) How to update a data in database in php. 29) How to retrieve all table from database in php. 30) How to retrieve all database from mysql server in php. 31) What is class. 32) what is object? 33) what is the […]

By |September 24th, 2017|Blogs|0 Comments

Addition of Consecutive Digits in a given Number Program

Hi, In this post, we are going to discuss Addition of Consecutive Digits in a given Number program. Add numbers by below Method We can take n numbers, For Example We can take 5, for this, we should take 1-5.  Now, we need to add the consecutive digits in the given number 5. (1+2)+(2+3)+(3+4)+(4+5)  = 24 Addition of Consecutive Digits in a given Number – Program: public class Program { public static void main(String[] args) { int result=0,i,a=0; System.out.print(“Enter the number of n value”+” “); int num; Scanner scan = new Scanner(; num = scan.nextInt(); for(i=1;i<num;i++){ int n=i; a= n+(++n); result=result+a; } System.out.println(“Total of n number is”+” ” +result); } }

By |September 24th, 2017|Blogs|0 Comments

Data Retrieval from Database in PHP – With Coding

Hi, Today we are going to know about how to retrieve data from database.  Here we are using mysql_fetch_array(); to get a particular row values. It stored all values in an array. Then we will call all values by its index names. Ok. This is our program, <?php $dbhost=”localhost”;      $dbuser=”root”;      $dbpass=””;      $conn=mysql_connect($dbhost,$dbuser,$dbpass);      mysql_select_db(“trainee”);      $result = mysql_query(“select * from details      where name=’Guhan’”);      $row= mysql_fetch_array($result); // It stores values in an array      for($i=0; $i<3; $i++)      {         echo $row[$i].”<br>”;      } ?> OUTPUT: Guhan Ganesan 979181****

By |September 12th, 2017|Blogs|0 Comments

Inserting Data in Table through PHP – With Coding

Hi, We have learned how to create table in last program. This program shows how to insert new data into the created table. Ok, Lets see the program, <?php /* Insert data into table */ $host = “localhost”; $user = “root”; $pass = “”; $connect=mysql_connect($host, $user, $pass); mysql_select_db(“trainee”); $query=”Insert into details values(‘Guhan’, ‘Ganesan’, ‘979181****’)”; $mysql=mysql_query($query); if($mysql) { echo “The Data is inserted into the table is success!!”; } ?> OUTPUT: The Data is inserted into the table is success!! /* Name Father Mobile Guhan Ganesan 979181**** */

By |September 12th, 2017|Blogs|0 Comments

Creating table in PHP – With Program

Hi, We have created a database “trainee” in last program. Now we are going to create a table inside the database “trainee”. I am assume a table name is details and columns are Name, Father and Mobile, all are having the length 20. Ok Let us go to the program, <?php /* Create New Table */ $host = “localhost”; $user = “root”; $pass = “”; $connect=mysql_connect($host, $user, $pass); mysql_select_db(“trainee”); // Select your created database to create new table $query=”create table Details(Name varchar(20), Father varchar(20), Mobile varchar(20))”; $mysql=mysql_query($query); if($mysql) { echo “New Table is created successfully”; } ?> OUTPUT: New Table is created successfully

By |September 12th, 2017|Blogs|0 Comments

View Database in PHP – With Coding

Hi, In last program, we have created a database “trainee”. Now we are going to see a created database by using given PHP program. You know very well how to connect and create new database, here we have used mysql_fetch_assoc(); to stores all databases in an associative array. The stored databases was selected by using while loop. Lets move into the program, <?php /* View All Databases */ $host = “localhost”; $user = “root”; $pass = “”; $connect=mysql_connect($host, $user, $pass); $query=”show databases”; $mysql=mysql_query($query); $row=mysql_fetch_assoc($mysql); // stores all databases as an associative array while($row=mysql_fetch_assoc($mysql)) { echo $row[‘Database’].”<br>”; } ?> OUTPUT: // The stored databases are information_schema mysql payilagam performance_schema phpmyadmin student test trainee // This is your last created database trainee

By |September 12th, 2017|Blogs|0 Comments

Creating Database in PHP – With Coding

Hi, In last program we learned how to connect given database with PHP page. In this program, you can get an idea with how to create new database. If you have a basic knowledge in MySQL query, it will very helpful to understand to learn this PHP program. Ok, Lets see the program <?php /* Create new  database */ $host = “localhost”; $user = “root”; $pass = “”; $connect=mysql_connect($host, $user, $pass); $query=”create database Trainee”; // This is your MySQL query(Database name is: Trainee) $mysql=mysql_query($query); // executes a query on a MySQL database. if($mysql) { echo “New Database is created successfully”; } ?> OUTPUT: New Database is created successfully

By |September 12th, 2017|Blogs|0 Comments

Database connection in PHP

Hi,        This post gives an information about how to connect PHP page to MariaDB. First open your admin page by using this url -> http://localhost/phpmyadmin/ now you can see the admin page. In that page, you can see the user account in menu. Now select user account, here you can see the username and password of host which you have used as a sever. Here you can create your own username and password also or you can choose given username and password for connecting PHP with Database. The following program shows how to establish connection between PHP page with Database. I am using the given username and password for your convenience. Ok, Lets go to the program. <?php /* Connect to Database */ $host = “localhost”;    // This is host name $user = “root”;            // This is username $pass = “”;                   // This is password( No password is given) $connect=mysql_connect($host, $user, $pass); // gives connection between php and databse if($connect) { echo “Successfully connected to database”;        // for our confirmation } ?> OUTPUT: Successfully connected to database  

By |September 12th, 2017|Blogs|0 Comments

Check Palindrome in PHP with Program

Hi,      I give an idea to check a given string is palindrome or not in php. In php, we use the “.” symbol for concatenating two strings. First of all, we should calculate the given string by using strlen(). I am considering the variable $x=”AMMA”; Here the length of the string is 4. We can get the every character from its indexes of  $x[0], $x[1], $[2], $x[3]. Each index values gives A, M, M, A. Then we should concatenate from last index with its previous index values till  its  starting index values by using the for loop. Ok, Let see program: <?php $x=”AMMA”; $n=””; $m=strlen($x); for($i=$m-1; $i>-1; $i–) { $n=$n.$x[$i]; } echo $n.”<br>”; if($x==$n) { echo “Given string is palindrome”; } ?>   OUTPUT: AMMA Given string is palindrome

By |September 6th, 2017|Blogs|0 Comments

Find Armstrong Number in PHP with Program

Hi, Find Armstrong Number in PHP With Program – This is one of the interview questions usually asked.  In this program, we will check the sum of cube values of individual digits are equal to given  number or not. Let us consider the number is 370. Here 3 cube is 27 and 7 cube is 343 and 0 cube is 0. The sum of all cube value is 370. Aim:(3*3*3+7*7*7+0*0*0)  First(at $i=0) we find modulus with 10(370%10) it gives result  0. Then calculate cube value using pow() , add with $s and assign whole value into $s again. Next we need 37 for remaining operations so that we divide again the given with 10. Here we have used three digit number, hence we have set for loop runs at three time. When  $i=0, $r will become 7, so $s=343. At final loop($i=2) $r=3, and $s=370. It gives same number  what  we have given. Ok, Lets go to the program: <?php $m = 370; $r=0; $s=0; for($i=0; $i<3; $i++) { $r=$m%10; $s=$s+pow($r,3); // {($i=0), 0*0*0} + {($i=1), 0+ 7*7*7} + {($i=2), 343+ 3*3*3} $m = $m/10; } echo $s.”<br>”; if($s=$m) { echo “Given Number is an Armstrong Number”; } ?> OUTPUT: 370 Given Number is an Armstrong Number

By |September 6th, 2017|Blogs|0 Comments