Cod: Selectaţi tot
if (
@!$_POST['ticket']['creator_int'] = $_SESSION['user_id'] OR
@!$_POST['ticket']['subject_str']
)
{
return $this->info(
'',
$this->language("MISSING_FIELDS"),
'warning',
true,
$this->url . 'tickets/add',
'3000'
);
}
# A hack..
if (@!$_POST['ticket']['status_int'])
$_POST['ticket']['status_int'] = 0;
$do = $this->db->query(
# Builds SQL syntax
$this->forms->sqlInsert($this->forms->bindList($_POST['ticket']), $this->prefix('tickets')),
# Builds Bind list
$this->forms->bindList($_POST['ticket'])
);
Cu acest script creez o linie noua in tabelul tickets
Cum pot in acelasi timp sa se creeze o linie noua si in tabelul ticketmsgs si sa se introduca si id-ul in `ticket` care s-a introdus in `ticketid` ?
Cam asa arata tabelul
Cod: Selectaţi tot
CREATE TABLE `ticketmsgs` (
`msgid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ticket` int(10) unsigned NOT NULL,
`message` text NOT NULL,
CREATE TABLE `tickets` (
`ticketid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`subject` varchar(255) NOT NULL,
`creator` int(10) unsigned NOT NULL,