Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts

Monday, October 15, 2018

MySQl, Excel, SQlite

26 slova engleskih
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z

CREATE TABLE excel (
A VARCHAR(40),
B VARCHAR(40),
C VARCHAR(40),
D VARCHAR(40),
E VARCHAR(40),
F VARCHAR(40),
G VARCHAR(40),
H VARCHAR(40),
I VARCHAR(40),
J VARCHAR(40),
K VARCHAR(40),
L VARCHAR(40),
M VARCHAR(40),
N VARCHAR(40),
O VARCHAR(40),
P VARCHAR(40),
Q VARCHAR(40),
R VARCHAR(40),
S VARCHAR(40),
T VARCHAR(40),
U VARCHAR(40),
V VARCHAR(40),
W VARCHAR(40),
X VARCHAR(40),
Y VARCHAR(40),
Z VARCHAR(40)
);

studenti.db
Select * FROM isplata where iznos>0
rb, oznaka, ime, adresa, iznos, broj_racuna


="UPDATE ispalata SET oznaka = 1, ime='"&C2&"', iznos='"&F2&"', broj_racuna='"&E2&"' WHERE rb=1;"

="UPDATE isplata SET oznaka = '"&A2&"', ime='"&C2&"', iznos='"&F2&"', broj_racuna='"&E2&"' WHERE rb=1;"


="UPDATE isplata SET oznaka = '"&A6&"', ime='"&B6&"', iznos='"&G6&"', broj_racuna='"&F6&"', adresa='"&C6&"' WHERE rb=1;"

="UPDATE isplata SET oznaka = '"&A2&"-"&B2&"', ime='"&C2&"', iznos='"&J2&"', broj_racuna='"&H2&"' WHERE rb=1;"



xxx-xxxxxxxx-xx



="INSERT INTO table_name VALUES('"&A1&"','"&B1&"','"&C1&"')"

INSERT INTO tbl_sample(first_name, last_name) VALUES('ime','prezime');


tbl_sample(first_name, last_name

CREATE TABLE IF NOT EXISTS eksel2 (
  id bigint(20) NOT NULL AUTO_INCREMENT,
  c01 text NULL,
  c02 text NULL,
  c03 text NULL,
  c04 text NULL,
  c05 text NULL,
  c06 text NULL,
  c07 text NULL,
  c08 text NULL,
  c09 text NULL,
  c10 text NULL,
  c11 text NULL,
  c12 text NULL,
  PRIMARY KEY (id)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8;




INSERT INTO eksel2(c01,c02,c03,c04,c05,c06,c07,c08,c09,c10,c11,c12) VALUES('1','2','3','4','5','6','7','8','9','10','11','12');


SQLite...:


CREATE TABLE `godisnji` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`ime` VARCHAR(40),
`jmbg` VARCHAR(13),
`po_osnovu_doprinosa_na_radu` INTEGER,
`po_osnovu_strucne_spreme` INTEGER,
`po_osnovu_godina_rada` INTEGER,
`po_osnovu_uslova_rada` INTEGER,
`po_osnovu_brige_o_deci` INTEGER,
`broj_maloletnih` INTEGER,
`broj_dece_do_14god` INTEGER,
`adresa` VARCHAR(80),
`telefon` VARCHAR(40),
`napomena` VARCHAR(80),
`datum_donosenja_resenja` VARCHAR(10),
`ukupno` INTEGER
);



CREATE TABLE `putnik` (
`oznaka` TEXT,
`ime` TEXT,
`ADRESA` TEXT,
`RODITELJ` TEXT,
`JMBG` TEXT,
`SKOLA` TEXT,
`GRAD` TEXT,
`relacija` INTEGER,
`naziv_relacije` TEXT,
`prvi_mesec` INTEGER,
`drugi_mesec` INTEGER,
`iznos` REAL,
`broj_racuna` TEXT,
`procenat` INTEGER,
`prvi_iznos` REAL,
`drugi_iznos` REAL
);


CREATE TABLE `osnovna_sredstva` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`naziv` VARCHAR(80),
`inventarski_broj` VARCHAR(20),
`serijski_broj` VARCHAR(80),
`model` VARCHAR(40),
`windows_key` VARCHAR(80),
`opis` VARCHAR(2000),
`sadrzaj` VARCHAR(2000),
`napomena` VARCHAR(200),
`vrednost` REAL,
`amortizacija` REAL,
`datum` VARCHAR(20),
`proizvodjac` VARCHAR(80),
`javna_nabavka` VARCHAR(200),
`revers` VARCHAR(200),
`trebovanje` VARCHAR(200),
`odgovorna_osoba` VARCHAR(60),
`storno` VARCHAR(40)
);



CREATE TABLE `finansije-glavna-knjiga` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`naslov` VARCHAR(80),
    `duguje` REAL,
    `potrazuje` REAL,
    `saldo` REAL,
`konto` VARCHAR(20),
`partner-kupac-dobavljac` VARCHAR(40),
`napomena` VARCHAR(1000),
`datum` VARCHAR(10),
`storno` VARCHAR(10)

);

CREATE TABLE `kontni-plan` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`sifra-konta` VARCHAR(20),
`naziv-konta` VARCHAR(80)
);

CREATE TABLE `partner` (
`rb` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE,
`sifra-partnera` VARCHAR(40),
`naziv-partnera` VARCHAR(80)
);


PRIMER praćenja sopstvenih troškova u prodavnici:






https://sr.wikipedia.org/sr-el/Dvojno_knjigovodstvo

http://informax.serveftp.com/progtools.asp









Friday, April 28, 2017

Elegantno merenje vremena izvrsenja PHP procedura

http://php.net/manual/en/function.microtime.php


ou can use microtime and calculate the difference:
$time_pre = microtime(true);
exec(...);
$time_post = microtime(true);
$exec_time = $time_post - $time_pre;


http://stackoverflow.com/questions/8310487/start-and-stop-a-timer-php

Koja je brzina tvog servera ? PHP

Koja je brzina tvog servera ?

<?phpif (isset($_GET['source']))
{
    
highlight_file($_SERVER['SCRIPT_FILENAME']);
    exit;
}
$maxNumKB 4096;$defNumKB 512;
if (!isset(
$_GET['numKB']) || intval($_GET['numKB']) > $maxNumKB)
{
    
header("Location: http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?numKB=$defNumKB");
    exit;
}
$numKB intval($_GET['numKB']);?><!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Jan! &raquo; PHP &raquo; speed test</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
    <!--
    html
    {
        font-family: sans-serif;
        color: #000;
        background: #fff;
    }
    *
    {
        font-size: medium;
    }
    #wait
    {
        border-bottom: thin dotted black;
    }
    #wait abbr
    {
        border: none;
    }
    #done
    {
        font-weight: bold;
    }
    #benchmark
    {
        padding: 1em;
        border: 1px solid black;
        background: #ffe;
        color: #000;
    }
    //-->
    </style>
</head>
<body>
<div id="benchmark">
<p>
    <strong>This not a script to benchmark or determine the execution speed
    of PHP scripts.</strong> If you're looking for one, check out the PEAR
    <a href="http://pear.php.net/package/Benchmark">Benchmark package</a>.
</p>
<p>
    This script sends <?php echo $numKB?> <abbr title="kilobyte">KB</abbr>
    of HTML comments to your client. Parsing that HTML may add to the total
    transfer time, so don't take this as your raw download speed.
</p>
</div>
<h1>Please wait</h1>
<p>
    <a href="<?php echo "http://{$_SERVER['HTTP_HOST']}{$_SERVER['PHP_SELF']}?source=1"?>">(Show source)</a>
</p>
<p id="wait">
    Transferring <?php echo $numKB?> <abbr title="kilobyte">KB</abbr>
</p>
<!--
<?phpfunction getmicrotime()
{
    list(
$usec$sec) = explode(" "microtime());
    return ((float)
$usec + (float)$sec);
}
flush();$timeStart getmicrotime();$nlLength strlen("\n");
for (
$i 0$i $numKB$i++)
{
    echo 
str_pad(''1024 $nlLength'/*\\*') . "\n";
    
flush();
}
$timeEnd getmicrotime();$timeDiff round($timeEnd $timeStart3);?>-->
<p id="done">
    <?php
        
echo "Transferred {$numKB} <abbr title=\"kilobyte\">KB</abbr> in {$timeDiff} seconds, " .
             (
$timeDiff <= "more than {$numKB}round($numKB $timeDiff3)) .
             
' <abbr title="kilobytes per second">KB/s</abbr>';
    
?></p>
</body>
</html>