Skip to content

Instantly share code, notes, and snippets.

View Kingo4luv's full-sized avatar

Kingsley Atanang Kingo4luv

View GitHub Profile
@charset "UTF-8";
/*
* Color Variables
*/
/*
* Layout Variables
*/
/*
* Layout Variables
*/
import sql from "mssql";
import states from "./states.js";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { Eta } from "eta";
const DEFAULT_DATE_FORMAT = {
timeZone: "US/Eastern",
dateStyle: "short",
};
@Kingo4luv
Kingo4luv / table.php
Created February 23, 2018 21:52
This file retrieve data from database and Display on the table
<?php
include 'init.php';
$sql = "SELECT * FROM users";
$results = $link->query($sql);
?>
<html>
<head>
<title>Retrieving From Database</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
</head>
@Kingo4luv
Kingo4luv / init.php
Created February 23, 2018 21:51
Database Connection script
<?php
$link = mysqli_connect("localhost", "root", "", "training");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
?>
@Kingo4luv
Kingo4luv / users.sql
Created February 19, 2018 23:54
Users table sql file
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 20, 2018 at 12:52 AM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@Kingo4luv
Kingo4luv / insert.php
Created February 19, 2018 23:09
This php file processes the form and send the collected data into the database
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("localhost", "root", "", "training");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
@Kingo4luv
Kingo4luv / Add_users.php
Created February 19, 2018 23:07
This file contains the form where we get data from users
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Add Record Form</title>
</head>
<body>
<form action="insert.php" method="post">
<p>
<label for="firstName">First Name:</label>