Skip to content

tajroshith/aws-alb-php-mysql-project

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Database Setup

########################################################################
Example Databse
########################################################################

create database college;
use college;

########################################################################
Example table
########################################################################

CREATE TABLE students(
name VARCHAR(20) NOT NULL,
age INT(3) NOT NULL,
email VARCHAR(30) NOT NULL
);

########################################################################
Example table content
########################################################################
INSERT INTO students(name,age,email) VALUES('kevin',20,'[email protected]');
INSERT INTO students(name,age,email) VALUES('sam',24,'[email protected]');
INSERT INTO students(name,age,email) VALUES('john',23,'[email protected]');
INSERT INTO students(name,age,email) VALUES('jane',25,'[email protected]');
INSERT INTO students(name,age,email) VALUES('devon',23,'[email protected]');
INSERT INTO students(name,age,email) VALUES('nelson',22,'[email protected]');
INSERT INTO students(name,age,email) VALUES('ron',26,'[email protected]');
INSERT INTO students(name,age,email) VALUES('jenna',23,'[email protected]');
INSERT INTO students(name,age,email) VALUES('julia',22,'[email protected]');
INSERT INTO students(name,age,email) VALUES('emma',21,'[email protected]');

Changing Database Connection Variables

# vim index.php

<?php
  
// Database Connection

$user = 'root';         
$password = 'mysqlroot123'; 
$database = 'college'; 
$servername='localhost:3306';
# vim index.html

<head>
    <meta charset="UTF-8">
    <title>This Version 1</title>
    <!-- CSS FOR STYLING THE PAGE -->

Changing Version

# vim index.php

<head>
    <meta charset="UTF-8">

    <title>This Version 1</title>  <<==========
    <style>
        table {
            margin: 0 auto;
            font-size: large;
            border: 1px solid black;
        }

About

php script to print database table

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%