Posts

Showing posts with the label select data from database using PHP

How to select data from mysql database using PHP

Image
In this tutorial we will learn how to select data from mysql database.First of all we need to connect to the database from which we will collect data.            $con=mysqli_connect("localhost","root","","youtube"); In the above code the root is the username of the mysql and the database name is "youtube".You can replace your database name in this portion.Now we will select data from database using select sql.        $query="select * from registration"; Here the table name is registration,the structure of the table is as follows:- Column Name Type rid int(11) name varchar(100) fathersname varchar(100) mothersname varchar(100) address varchar(200) email varchar(200) uname varchar(200),Primary Key password varchar(200) In the next step we will execute the query ,after execution we will get a result set.Now we will supply that result set to also mysqli_fetch_row(),which will fetch the rows fr...