ankitweblogic logo
W e b t u t o r i a l s

Define PHP

PHP Installation

PHP INI File

PHP Case Sensitivity

PHP Variable

PHP Echo & Print

PHP Operators

PHP Receiving Input

PHP Decision Making

PHP Loops

PHP Jumping Statement

PHP Image Gallery

PHP Arrays

PHP File Upload

PHP String Functions

PHP Math Functions

PHP Functions

PHP Variable Scope

PHP Constant Variable

PHP Superglobals

PHP Form Validation

PHP Include Statement

PHP Filter

PHP File Handling

PHP Date Functions

PHP Cookies

PHP Session

PHP Send Emails

PHP Captcha

PHP-MySQL Connectivity

PHP MySQL Select

PHP MySQL Insert

PHP MySQL Delete

PHP MySQL Update

PHP MySQL Injection

PHP MySql Connect

<?php
	$conn = mysqli_connect("localhost", "root" , "", "student");
	
	if($conn === false){
		die("ERROR: Could not connect to database.");
	}
	
	$sql = "select * from book";
	$result = mysqli_query($conn, $sql);
	
	while($rows = mysqli_fetch_array($result))
	{
		echo $rows['Id'] . $rows['Name'] . "<br>";
	}
	
	mysqli_close($conn);
?>