Program: <?php $host = "localhost"; $user = "root"; $pass = "1234"; $dbname = "...
Read More
35 Program to display data from MySQL Database in PHP.
Program: <?php $host = "localhost"; $user = "root"; $pass = "1234"; $dbname = ...
Read More
34 Program to Insert Data in MySQL Database using PHP
Database: 1) CREATE DATABASE EMPLOYEES; 2) USE EMPLOYEES; 3) CREATE table emp(id int PRIMARY KEY,name Varchar(20),Salary Integer); Pro...
Read More
33 Program to connect PHP with MySQL Database using PDO::__construct().
Program: <?php $host = "localhost"; $user = "root"; $pass = "1234"; try { ...
Read More
32 Program to connect PHP with MySQL Database using mysqli_connect().
Program: <?php $host = "localhost"; $user = "root"; $pass = "1234"; $conn = my...
Read More
31 Program to Destroy Session in PHP
Program: <?php session_start(); // Destroy Session Variable session_unset(); // Destroy Session session_d...
Read More
30 Program to Get Session Variables in PHP.
Program: <?php session_start(); $_SESSION["favcolor"] = "green"; $_SESSION["favanimal"]...
Read More
29 Program to start session in PHP
Program: <?php session_start(); $_SESSION["favcolor"] = "green"; $_SESSION["favanimal"]...
Read More
28 Program to delete cookies in PHP
Program: <?php setcookie("name",null,time()-3600); // Set the expiration time 1 hour ago echo "Cook...
Read More
27 Program to modify cookies in PHP
To modify cookie, just set(again) the cookie using the setcookie() function. Program: <?php $cookie_name = "Name"; ...
Read More
26 Program to create Cookies in PHP
Program: <?php $cookie_name = "Name"; $cookie_value = "Atharva"; setcookie($cookie_name,$cookie_v...
Read More
25 Program to demonstrate Server Role in PHP
Program: <html> <body> <?php if(date('G')<12) echo "Good Morning ".date...
Read More
Subscribe to:
Posts (Atom)