This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dvě tabulky – tabulka 'a' obsahuje pouze primární klíč 'id', tabulka 'b' obsahuje dva cizí klíče 'a1' a 'a2' – oba odkazují na 'a.id' – s vlastnostní ON DELETE CASCADE | |
CREATE TABLE `a` ( | |
`id` int(11) NOT NULL, | |
PRIMARY KEY (`id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
CREATE TABLE `b` ( | |
`a1` int(11) NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function barDump($var, $title='') | |
{ | |
$backtrace = debug_backtrace(null/*, 2*/); // Ready for PHP 5.4 | |
$source = (isset($backtrace[1]['class'])) ? | |
$backtrace[1]['class'] : | |
basename($backtrace[0]['file']); | |
$line = $backtrace[0]['line']; | |
if($title !== '') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace FrontModule; | |
class CenikPresenter extends BasePresenter | |
{ | |
public function renderDefault() | |
{ | |
$this->template->anyVariable = 'any value'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cetnost_tematu = 3; // vytáhne z db | |
$i = 0; | |
do { | |
mysql_query("INSERT INTO rezervace (id_tema,cetnost) VALUES ($tema,$i)"); | |
$i++; | |
}while($i < $cetnost_tematu && mysql_errno() == 1062); // dokud nedosahnu maximalni cetnosti a insert selhal na unikatnosti zaznamu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
files=($(find $1 -type f -printf "%f\r\n")) | |
num_files=${#files[*]} | |
echo "${files[$((RANDOM%num_files))]}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<textarea cols="150" rows="30">{!$form}</textarea> |
NewerOlder