Skip to content

Instantly share code, notes, and snippets.

@jeggu96
jeggu96 / displaytablecontent.php
Last active April 27, 2017 16:25
This PHP code is used to display the table content from the DB into a table in HTML
<?php
define("DB_HOST","localhost");//DB HOST NAME
define("DB_NAME","login");// DB NAME
define("DB_USERNAME","root");// DB USERNAME
define("DB_PASSWORD","");// DB PASSWORD
$conn=@mysqli_connect(DB_HOST,DB_USERNAME,DB_PASSWORD,DB_NAME); // CONNECT TO THE DB
$query="SELECT * from users"; // SQL QUERY TO SELECT ALL THE COLUMNS OF THE TABLE
$response =@mysqli_query($conn,$query);// GET RESPONSE FROM THE DB
if($response){ // IF RESPONSE IS TRUE
echo '<table align="left" cellpadding="5" cellpadding="8" border="1">
@jeggu96
jeggu96 / castle_code.html
Created April 2, 2018 17:05
The castle code left by the previous architect was all messed up.
<div class="castle">
<div class="walls">
<h1 class="gate_open">CASTLE GATE</h1>
<p class="tower">TOWER</p>
<a class="moats" href="castle_moats.com"></a>
</div>
</div>
<div class="castle">
<div class="castle__walls">
<h1 class="castle__gate-open">CASTLE GATE</h1>
<p class="tower--size-big">TOWER</p>
<a class="castle__moats" href="castle_moats.com"></a>
</div>
</div>