Ticker

6/recent/ticker-posts

PHP DATABASE CONNECTIVITY USING MYSQL

                          PHP DATABASE CONNECTIVITY USING MYSQL

HI friends !!
      Today i discuss to you that how to connect the log in form to database(MySQL).

*Before this process we firstly install the xampp server on our computer and start the service on Apache and MySQL . 

1. firstly we make the database on my log in form where we can store the all of log in information like as user-id and password . you can create own database with any name . here in this sheet we create the database on 'test' name.

Make database :
A. type localhost on your web browser 
B. go to the phpMyAdmin
C. click on database to create it
D. write the database name and click the create button
E. create the table on this database. write the name of table and put on the field on this table and click go button
2. After create the database we create the table on this database where the data will  be store. you can create own table by any name . here we create the table on 'users' name.
3. After that we write a simple database code with log in form . where the action will be perform on this page.
4. After that we save this log in form by 'login' name in here C:/XAMPP/htdoc/newfolder/login.php
5. After that we firstly started the xampp server and start the service on Apache and MySQL . 
6. After that we can run this file on any web browser . firstly we write on these statues bar we type the 
localhost/newfolder/login.php  





                                    SIMPLE CODE ON DB-CONNECTIVITY WITH MYSQLI, MYSQL

<?php
         $host = "localhost";
         $user = "root"; 
         $pass = "";
         $db = "test";
        $mysqli = new mysqli($host, $user, $pass, $db);
      if($mysqli == true){
     echo 'connect success';
      }else{ echo 'error.'; }
   ?>

Post a Comment

1 Comments