php program

PHP Interview Questions & Answers Part – 9 0

PHP Interview Questions & Answers Part – 9

Program 1 <html> <head><title>PHP Interview Questions with DataBase</title></head> <body> <center> <?php /* what are different types of fetch function in PHP //mysqli_fetch_assoc() // mysqli_fetch_array() // mysqli_fetch_row() // mysqli_fetch_field() // mysqli_fetch_all() */ ?> </center> </body>...

PHP Menu Driven Application Part – 2 0

PHP Menu Driven Application Part – 2

Program 1 <html> <body> <center> <table border=1> <tr bgcolor=yellow><th >————Menu Application———-</th></tr> <tr bgcolor=cyan> <td>1. Factorial Of Number</td> </tr> <tr bgcolor=green> <td>2. Reverse Of Number</td> </tr> <tr> <td>3. Palindrom Number</td> </tr> <tr bgcolor=blue> <td>4. Armstrong...

PHP Menu Driven Application Part – 1 0

PHP Menu Driven Application Part – 1

Program 1 <?php include ‘MenuApplication.php’?> <html> <head><title>Factorial Page</title></head> <body> <center> <br><h5>Enter A Number</h4> <form method=post action=factorial.php> <input type=text name=txnumber> <input type=submit value=submit name=btnsubmit1> </form> <?php if(isset($_POST[‘btnsubmit1’])) { $n=$_POST[‘txnumber’]; $f=1; while($n!=0) { $f=$f*$n; $n–; }...

Deletion Method in PHP ORM Architecture 0

Deletion Method in PHP ORM Architecture

Program 1 <?php require ‘dao.php’; require ‘model.php’ ?> <html> <body> <br><br><br><br><br><br><br><br><br><br> <center> <form method=post action=”DeleteStudent.php”> <table border=1> <tr> <th>Student Id for Delete</th> <td><input type=text name=txtid></td> </tr> <tr> <td></td> <td><input type=submit value=Search name=btnSubmit></td> </tr> </table>...

Searching Method in PHP ORM Architecture 0

Searching Method in PHP ORM Architecture

Program 1 <?php require ‘dao.php’; require ‘model.php’ ?> <html> <body> <br><br><br><br><br><br><br><br><br><br> <center> <form method=post action=”SelectStudent.php”> <table border=1> <tr> <th>Student Id</th> <td><input type=text name=txtid></td> </tr> <tr> <td></td> <td><input type=submit value=Search name=btnSubmit></td> </tr> </table> <pre> <?php...

Insertion Method in PHP ORM Architecture 0

Insertion Method in PHP ORM Architecture

Program 1 <?php require ‘dao.php’; require ‘model.php’; ?> <html> <body> <br><br><br><br><br><br><br><br><br><br> <center> <form method=post action=”InsertStudent.php”> <table border=1> <tr> <th>Student Id</th> <td><input type=text name=txtid></td> </tr> <tr> <th>Name</th> <td><input type=text name=txtname></td> </tr> <tr> <th>Physics</th> <td><input type=text...

What is Data Access Object Model in PHP ORM Architecture 0

What is Data Access Object Model in PHP ORM Architecture

Program 1 <?php class MyConnection { public function getConnection() { $mycon=mysqli_connect(“localhost”,”root”,””,”Library”) or die(“Connection not success”); return $mycon; } } ?> Program 2 <?php require ‘dao.php’; require ‘model.php’; ?> <html><head><title>This is test page of connection</title></head>...

PHP __toString() Method with Examples 0

PHP __toString() Method with Examples

Program 1 <html> <head><title>Demo</title></head> <body> <center> <?php class Product { private $pname; private $price; private $qty; public function __construct($name,$pr,$qt) { $this->pname=$name; $this->price=$pr; $this->qty=$qt; } public function __tostring() { //return “<br>This is to String method<br>”;...

PHP unserialize() Function with Examples 0

PHP unserialize() Function with Examples

Program 1 <html> <head><title>Demo</title></head> <body> <center> <?php class Employee { private $empname; private $empsalary; private $empdept; public function setdata($name,$sal,$dept) { $this->empname=$name; $this->empsalary=$sal; $this->empdept=$dept; } public function __construct() { echo “<br>This is Constructor method MYSQL...

Object Cloning in PHP 0

Object Cloning in PHP

Program 1 <html> <head><title>Demo</title></head> <body> <center> <?php class Employee { public $empname; public $department; // sub object of department class public function __construct($ename,$d1) { $this->empname=$ename; $this->department=$d1; } public function __clone() { echo “<br><font color=red>***********This...