Skip to content

bhsingh1/php-mariadb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-MariaDB-Demo

Prepare Database

Create a mariadb database :

Database Name : studentdb

Create a table students using following sql :

Create table students (student_id int(2), first_name varchar(30), last_name varchar(30), hrs_completed int(3), hrs_attempted int(3), gpa_points int(2), major varchar(50), advisor_id int(5), email varchar(256));


Insert a value using sql :

Insert into students values (1, 'Bhawani', 'Singh', 10, 8, 9, 'Science', 231, '[email protected]');


Create a table advisors using following sql :

Create table advisors (advisor_id int(3), name varchar(256), email varchar(256));


Insert a value using sql :

Insert into advisors values (231, ‘Mr. Advisor’, ‘[email protected]’);

IMPORTANT NOTE : Advisor ID needs to match in both tables otherwise record display and insertion will fail through app user interface. Insert as many values are required.



Update DB Connection String Values in getStudentData.php

$dsn = "mysql:host=172.30.37.79; port=3306 ;dbname=studentdb; charset=utf8";
$username = "dbadmin";
$password = "dbpassword";

Build PHP S2I using git repo url

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published