Category: PHP

PHP Project

Address Book System A minor project in PHP.Databsae: PHPMyAdmin, Wamp Server Code for Insert data into Database: <html><body><form><table align=”center”><tr><td>Name:</td><td><input type=”text” name=”name”></td></tr><tr><td>Mobile:</td><td><input type=”text” name=”mobile”></td></tr><tr><td>Gender:</td><td><input type=”radio” value=”Female” name=”gender”>Female<input type=”radio” value=”Male” name=”gender”>Male</td></tr><tr><td>Colony:</td><td><input type=”text” name=”colony”></td></tr><tr><td>City:</td><td><input type=”text” name=”city”></td></tr><tr><td>Pin code:</td><td><input type=”text” name=”pincode”></td></tr><tr><td><input type=”submit” value=”Save” name=”save”></td></tr></table></form></body></html> <?phpif(isset($_REQUEST[‘save’])){$name = $_REQUEST[‘name’];$mobile = $_REQUEST[‘mobile’];$gender = $_REQUEST[‘gender’];$colony = $_REQUEST[‘colony’];$city = $_REQUEST[‘city’];$pincode = $_REQUEST[‘pincode’]; $connection = Mysqli_connect(“localhost”,”root”,””,”addressbookdb”);$query […]

Select statement in SQL

Different ways to use ‘select’ statement in SQL, DBMS MySQL. mysql> select *from student where roll_no<45 span=””>+——–+——–+———+| f_name | s_name | roll_no |+——–+——–+———+| prasan | s | 40 || noman | r | 36 || ayushi | m | 9 || minal | m | 35 || khushi | j | 20 || nikita | […]

LIKE IN SQL mySQL

There are different ways to use ‘like’ in SQL. Each way of using ‘like’ gives a different result. Which is shown in screenshot below. ‘Like’ is used to print and find the string characters from table.

SQL in MySQL

SQL in MySQL 1. Firstly we have to start MySQL 5.5 Command line client then we need to enter password, created during installation. After entering password, screen looks like below 2. To create database: Creation of database is necessary, before creating any table. To create a database in sql, follow following syntax.Syntax: – create database ;For Example: – […]

PHP Loops

Often when you write code, you want the same block of code to run over and over again in a row. Instead of adding several code-lines in a script, we can use loops to perform a task like that.By using loops statements we can decrease the number of code lines.In PHP, there are following looping […]

PHP Switch Statement

PHP (Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language.Originally created by Rasmus Lerdorf in 1994. PHP code may be embedded into HTML […]

PHP Constant

Constants are variables that except once they are defined they cannot be undefined or changed. A constant is an identifier or a name.The value cannot be changed during the script.A valid constant in PHP can be start with letter or underscore.Create a PHP Constant ?To create a constant in PHP, use the ‘define ()’ function […]

PHP Data types

DATATYPES IN PHP Data Types: Data types defines the type of values a variable can store. PHP supports the following data types:· String· Integer· Float (floating point numbers – also called double)· Boolean· Array· Object· NULL String : A string is a collection of characters, like “Hi guys”.We use quotes(” “) to define a string. […]

PHP Variables

Variables in PHP Variables are like a container to store data.Variables in php starts with Dollar sign ($). Example: $a = “Hello”;$b = 50;$c = 10.50;?> OUTPUT: Hello5010.50 In the above example , there are 3 variables a,b,c which holds values “Hello”,”50″ and”10.50″ respectively. Rules to declare a variable: A variable starts with the $ […]

INSTALLATION OF MYSQL ON WINDOWS

This article is about the installation of MySQL 5.5. Firstly check the configuration of a system is either 32 bit or 64 bit. Download the setup of MySQL according to configuration of system from http://dev.mysql.com/downloads/setup or copy the setup from other device to the device by the means of pendrive or any data transportable device. Let’s […]

How to get MySQL

MySQL MySQL is an open source relational database management system (RDBMS) based on Structured Query Language (SQL). From where we can download the MySQL setup There are many sites for downloading the MySQL setup at free. https://dev.mysql.com/downloads/ www.mysql.com www.ntu.edu.sg https://filehippo.com/download_mysql/ Steps to download MySQL Step 01 Check the configuration in our computer to download setup. […]