PHP Connection Mysql Database Steps

PHP Connection Mysql Database Steps

Today, We want to share with you PHP Connection Mysql Database Steps.
In this post we will show you PHP Connection Mysql Database Steps, hear for PHP Connection Mysql Database Steps we will give you demo and example for implement.
In this post, we will learn about Connection Mysql Database using PHP Example with an example.

File Structure using PHP DATABASE CONNECTION :

inc – foldername

filename : connection.php

filename : db_connection.php

filename : dbclass.php

filename : settings.php

The Plan simple database connection in PHP

  • make the connection and select the database.
  • perform the query on the table.
  • print out the data.
  • close the connection.
  • The first thing first of all to do is connect to the database connection.The used mysql function to connect to MySQL is called mysql_connect in database using PHP.

    settings.php

    
    

    connection.php

    
    Connect($SERVER_HOST, $SERVER_USER, $SERVER_PASSWORD, $SERVER_DATABASE); 
    ?>
    

    dbclass.php

     $Values){
    				$FetchAllData[$i][$Key] = $Values;
    			}
    		$i++;	
    		}
    		//print_r($FetchAllData);
    		return $FetchAllData;
    	}
    	
    	function NumRows($Query) {
    		$NumRows = "";
    		$NumRows = mysql_num_rows($Query);
    		return $NumRows;
    	}
    }
    ?>
    

    db_connection.php

    
    

    View Demo

    We hope you get an idea about PHP Connection Mysql Database Steps
    We would like to have feedback on my Information blog .
    Your valuable any feedback, Good question, Inspirational Quotes, or Motivational comments about this article are always welcome.
    If you liked this post, Please don’t forget to share this as Well as Like FaceBook Page.

    We hope This Post can help you…….Good Luck!.

    Leave a Comment