ACC SHELL
<?php
require("common.php");
init_db();
/*
$query =
"CREATE TABLE `jobs` (".
" `job_id` int(11) NOT NULL auto_increment,".
" `visible` tinyint(1) NOT NULL,".
" `name` mediumtext NOT NULL,".
" `description` mediumtext NOT NULL,".
" `date_from` datetime NOT NULL,".
" `date_to` datetime NOT NULL,".
" `user_id` int(11) NOT NULL,".
" PRIMARY KEY (`job_id`)".
") TYPE=MyISAM AUTO_INCREMENT=1" ;
echo $query;
mysql_query($query) or die('Invalid query: ' . mysql_error());
//echo (int)$result;
*/
function add_job($description, $date_from, $date_to, $visible)
{
$query =
"INSERT INTO jobs (description, date_from, date_to, visible) VALUES (" .
quote_smart($description) . ", " .
quote_smart($date_from) . ", " .
quote_smart($date_to) . ", " .
($visible ? "'1'" : "'0'") . ")";
mysql_query($query) or die("Nepodarilo se pridat brigadu (" . $query . ")");
return mysql_insert_id();
}
add_job("pokusna brigada", date("Y-m-d H-i-s"), date("Y-m-d H-i-s"), 1);
?>
ACC SHELL 2018