I have the following SQL:
INSERT INTO Invite VALUES (NULL,?,(SELECT id FROM User WHERE name = ?),?); However this doesnt seem to work.
Can anyone tell me what i am doing wrong?
Update
The following php code gives me erro code 1136:
$sql = 'INSERT INTO Invite SELECT NULL, ?, id, ? FROM User WHERE username = ?'; $variables = array($team_id,$_SESSION['User']['id'],$username); $result = $this->db->prepTemplate($sql, 'iis', $variables);