PHP Tutorials

How to Delete the Record in PHP GUI Application 0

How to Delete the Record in PHP GUI Application

Program 1 <html> <body> <center> <form method=post action=”StudentDelete.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> </form> <pre> <?php if(isset($_POST[‘btnSubmit’])) { $stid=$_POST[‘txtid’]; session_start();...

How to Select the Data of Student in PHP GUI Application 0

How to Select the Data of Student in PHP GUI Application

Program 1 <html> <body> <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 if(isset($_POST[‘btnSubmit’])) { $stid=$_POST[‘txtid’]; $mycon=mysqli_connect(“localhost”,”root”,””,”Library”) or die(“Connection not...

How to Execute Parameterized Query in PHP GUI Application 0

How to Execute Parameterized Query in PHP GUI Application

Program 1 <html> <body> <center> <form method=post action=”InsertStudent1.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 name=txtphy></td> </tr> <tr> <th>Chemistry</th> <td><input type=text name=txtchem></td>...

How to Insert Record in PHP GUI Application 0

How to Insert Record in PHP GUI Application

Program 1 <html> <body> <center> <form> <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 name=txtphy></td> </tr> <tr> <th>Chemistry</th> <td><input type=text name=txtchem></td> </tr> <tr>...

How to Read and Select Data in PHP MySQL 0

How to Read and Select Data in PHP MySQL

Program 1 <html> <body> <center> <pre> <?php $servername=”localhost”; $username=”root”; $password=””; $dbname=”Library”; $mycon=mysqli_connect($servername,$username,$password,$dbname); if($mycon->connect_error) die(“Connection failed….”); else { echo “Connection success……”; $sql=”select * from student”; // mysqli_query($mycon,$sql); $record=$mycon->query($sql); if(mysqli_num_rows($record)>0) { // print_r($record); echo “<br>”; while($row=mysqli_fetch_assoc($record))...

How to Insert Multiple Record in PHP MySQL 0

How to Insert Multiple Record in PHP MySQL

Program 1 <html> <body> <center> <pre> <?php // Connection $servername=”localhost”; $username=”root”; $password=””; $dbname=”Library”; $mycon=mysqli_connect($servername,$username,$password,$dbname); if($mycon->connect_error) die(“Connection failed….”); else { echo ” Connection success<br>”; $sql=”insert into student values(105,’Ranu’,’Mtech’);”; $sql.=”insert into student values(106,’Vishal’,’Btech’);”; $sql.=”insert into student...

How to Insert, Update and Delete Record in PHP MySQL 0

How to Insert, Update and Delete Record in PHP MySQL

Program 1 <html> <body> <center> <pre> <?php $servername=”localhost”; $username=”root”; $password=””; $dbname=”Library”; $mycon=mysqli_connect($servername,$username,$password,$dbname); if($mycon->connect_error) die(“Connection failed….”); else { echo “Connection success……”; $sql=”insert into student values(105,’Ashok’,’Mtech’);”; echo $mycon->query($sql); echo “: Record inserted….”; } $mycon->close(); echo “Connection...

How to Create Alter Drop Table in PHP MySQL 0

How to Create Alter Drop Table in PHP MySQL

Program 1 <html> <body> <center> <pre> <?php $servername=”localhost”; $username=”root”; $password=””; $dbname=”Library”; $mycon=mysqli_connect($servername,$username,$password,$dbname) or die(“Connection failed….”); echo “Connection success……”; // create table $sql=”create table student(sid int(5) Primary key ,sname varchar(30),course varchar(30))”; //$sql=”alter table student add...

How to Run a PHP File using XAMPP 0

How to Run a PHP File using XAMPP

Program 1 <html> <body> <center> <pre> <?php $mycon=mysqli_connect(“localhost”,”root”,””,”Library”); echo “Connection done successfully……………..”; ?> </pre> </center> </body> </html>  

Cookies in PHP 0

Cookies in PHP

Program 1 <html> <head><title>User Login Application for Cookies</title> <body> <center> <form method=post action=”testCookie2.php” > <table border=1> <tr> <th>User Name: </th> <td><input type=text name=txtuser></td> </tr> <tr> <th>Password: </th> <td><input type=password name=txtpass></td> </tr> <tr> <td></td> <td><input...