MySQL veldnamen weergeven

accounts
Field Type Key Default Extra
id int(11) NO PRI
username varchar(25) NO
password varchar(64) NO
email varchar(70) NO
role enum('default','admin','owner') NO owner


afspraken
Field Type Key Default Extra
id int(10) NO PRI
type varchar(30) NO
datum varchar(30) NO
adres varchar(50) NO
opmerkingen varchar(200) NO


antwoorden
Field Type Key Default Extra
id int(11) NO PRI
ip varchar(20) NO
antwoorden varchar(255) NO
datum datetime NO


blog
Field Type Key Default Extra
id int(10) NO PRI
title varchar(255) NO
content text NO
last_update datetime NO
author varchar(255) NO Elvis Hsu


counter
Field Type Key Default Extra
c_ID int(11) NO PRI
c_count int(11) NO
c_IP varchar(255) NO
browser varchar(255) NO


csv
Field Type Key Default Extra
id int(11) NO PRI
Deelnemernummer varchar(255) YES
Volledige naam varchar(255) YES
Onderwijsproduct varchar(255) YES
Naam varchar(250) NO
Res. varchar(250) NO


customers
Field Type Key Default Extra
customerNumber int(11) NO PRI
customerName varchar(50) NO
contactLastName varchar(50) NO
contactFirstName varchar(50) NO
phone varchar(50) NO
addressLine1 varchar(50) NO
addressLine2 varchar(50) YES
city varchar(50) NO
state varchar(50) YES
postalCode varchar(15) YES
country varchar(50) NO
salesRepEmployeeNumber int(11) YES
creditLimit double YES


datum
Field Type Key Default Extra
id int(10) NO PRI
datum date NO
tijd time NO


ecard
Field Type Key Default Extra
id int(10) NO PRI
naam varchar(200) NO
afbeedling varchar(50) NO
prijs double NO


employees
Field Type Key Default Extra
employeeNumber int(11) NO PRI
lastName varchar(50) NO
firstName varchar(50) NO
extension varchar(10) NO
email varchar(100) NO
officeCode varchar(10) NO
reportsTo int(11) YES
jobTitle varchar(50) NO


functies
Field Type Key Default Extra
id int(10) NO PRI
functie varchar(50) NO


gd_graph
Field Type Key Default Extra
month char(3) NO
sales int(3) NO 0


gebruikers
Field Type Key Default Extra
id int(10) NO PRI
gebruikersnaam varchar(100) NO
email varchar(50) NO
wachtwoord varchar(100) NO


leden
Field Type Key Default Extra
id int(10) NO PRI
groupID int(10) NO
loginKey varchar(255) NO
loginDate datetime NO
userName varchar(255) NO
passWord varchar(255) NO
passWordMD5 varchar(255) NO


logins
Field Type Key Default Extra
uid varchar(54) NO
sid varchar(54) NO
ip varchar(256) NO
datum datetime NO


members
Field Type Key Default Extra
id int(11) NO PRI
users text NO
password text NO
ip text NO
status text NO


mvcpdo
Field Type Key Default Extra
id int(11) NO PRI
Voornaam varchar(50) NO
Achternaam varchar(50) NO
Leeftijd int(11) NO
Woonplaats varchar(50) NO
lastmodified timestamp NO CURRENT_TIMESTAMP


mytable
Field Type Key Default Extra
id int(11) NO PRI
username varchar(50) YES
password varchar(50) NO
email varchar(75) NO


news
Field Type Key Default Extra
id int(11) NO PRI
title text NO
content text NO


nnews
Field Type Key Default Extra
id int(4) NO PRI
by varchar(100) NO
message text NO
title varchar(100) NO
date datetime NO
modified datetime NO


offices
Field Type Key Default Extra
officeCode varchar(10) NO PRI
city varchar(50) NO
phone varchar(50) NO
addressLine1 varchar(50) NO
addressLine2 varchar(50) YES
state varchar(50) YES
country varchar(50) NO
postalCode varchar(15) NO
territory varchar(10) NO


orderdetails
Field Type Key Default Extra
orderNumber int(11) NO PRI
productCode varchar(15) NO PRI
quantityOrdered int(11) NO
priceEach double NO
orderLineNumber smallint(6) NO


orders
Field Type Key Default Extra
orderNumber int(11) NO PRI
orderDate datetime NO
requiredDate datetime NO
shippedDate datetime YES
status varchar(15) NO
comments text YES
customerNumber int(11) NO


payments
Field Type Key Default Extra
customerNumber int(11) NO PRI
checkNumber varchar(50) NO PRI
paymentDate datetime NO
amount double NO


producten
Field Type Key Default Extra
id int(10) NO PRI
naam varchar(50) NO
prijs varchar(10) NO
bestelnummer varchar(50) NO
aantal int(11) NO


productlines
Field Type Key Default Extra
productLine varchar(50) NO PRI
textDescription varchar(4000) YES
htmlDescription mediumtext YES
image mediumblob YES


products
Field Type Key Default Extra
productCode varchar(15) NO PRI
productName varchar(70) NO
productLine varchar(50) NO
productScale varchar(10) NO
productVendor varchar(50) NO
productDescription text NO
quantityInStock smallint(6) NO
buyPrice double NO
MSRP double NO


quiz
Field Type Key Default Extra
id int(10) NO PRI
vraag varchar(255) NO
antwoord varchar(50) NO
categorie varchar(50) NO
vak varchar(50) NO


resultaat
Field Type Key Default Extra
id int(10) NO PRI
naam varchar(20) NO
cijfer varchar(20) NO
datum varchar(50) NO
ip varchar(20) NO


sessions
Field Type Key Default Extra
session_id varchar(32) NO PRI
user_id int(11) NO 0
session_logged_in tinyint(1) unsigned NO 0
session_start int(10) unsigned NO 0
session_last_update int(10) unsigned NO 0
session_ip varchar(30) NO
session_length int(11) NO 0


shoutbox
Field Type Key Default Extra
id int(11) NO PRI
name varchar(50) NO
message tinytext NO
zeit bigint(20) NO


student
Field Type Key Default Extra
id int(2) NO PRI
name varchar(50) NO
class varchar(10) NO
mark int(3) NO 0
sex varchar(6) NO male


test
Field Type Key Default Extra
id int(11) NO PRI
voornaam varchar(255) NO
achternaam varchar(255) NO
leeftijd int(10) NO
product varchar(250) NO
timestamp int(20) YES
ip varchar(25) NO
image varchar(250) NO


test2
Field Type Key Default Extra
id int(10) NO PRI
voornaam varchar(25) NO
achternaam varchar(25) NO
adres varchar(50) NO
postcode varchar(8) NO
woonplaats varchar(30) NO
email varchar(30) NO
telefoon varchar(15) NO


testmvc
Field Type Key Default Extra
voornaam char(50) YES
achternaam char(50) YES
leeftijd double YES


testoop
Field Type Key Default Extra
voornaam char(50) YES
Name char(50) YES
Marks double YES


testtest
Field Type Key Default Extra
Roll int(11) YES
Name char(50) YES
Marks double YES


user_info
Field Type Key Default Extra
Username varchar(32) NO PRI
Password varchar(32) YES
email varchar(40) NO


users
Field Type Key Default Extra
id tinyint(4) NO PRI
username varchar(10) NO
password varchar(100) NO


vragen
Field Type Key Default Extra
id int(11) NO PRI
vraag varchar(255) NO
antwoorden text NO


werknemers
Field Type Key Default Extra
id int(10) NO PRI
voornaam varchar(40) NO
tussenvoegsel varchar(10) NO
achternaam varchar(40) NO
geboortedatum tinyint(10) NO
salaris_schaal int(5) NO
functie_id int(5) NO


werknemers3
Field Type Key Default Extra
id int(8) NO PRI
voornaam varchar(50) NO
tussenvoegsel varchar(4) YES
achternaam varchar(75) NO
geboortedatum date NO
salaris_schaal int(2) YES 10


<h1>MySQL veldnamen weergeven</h1>
<?php 
/********Mysql tabelnamen uitlezen ********/

//Connect importeren
include "connecti.php"

// Database naam opgeven..
//$database = "DATABASENAAM";
$sql "SHOW tables FROM $database";

$result $mysqli->query($sql);

//loop to show all the tables and fields 
while($table mysqli_fetch_array($result)) 


    echo 

        <table cellpadding=\"2\" cellspacing=\"2\" border=\"0\" width=\"75%\"> 
            <tr bgcolor=\"#666666\"> 
                <td colspan=\"5\" align=\"center\"><b><font color=\"#FFFFFF\">" 
$table[0] . "</font></td> 
            </tr> 
            <tr> 
                <td>Field</td> 
                <td>Type</td> 
                <td>Key</td> 
                <td>Default</td> 
                <td>Extra</td> 
            </tr>"


    
$i 0//row counter 
    
$row mysqli_query($mysqli"SHOW columns FROM " $table[0])
    or die (
'cannot select table fields');

    while (
$col mysqli_fetch_array($row)) 
    { 
        echo 
"<tr"

        if (
$i == 0
            echo 
" bgcolor=\"#CCCCCC\""

        echo 
"> 
            <td>" 
$col[0] . "</td> 
            <td>" 
$col[1] . "</td> 
            <td>" 
$col[2] . "</td> 
            <td>" 
$col[3] . "</td> 
            <td>" 
$col[4] . "</td> 
        </tr>"


        
$i++; 
    } 
//end row loop 

    
echo "</table><br/><br/>"
//end table loop 

show_source(__FILE__); 
?>