$sql = "SELECT * FROM Inscricao WHERE al_id = ".$_GET['idc'];
$sql = "SELECT * FROM Aluno WHERE al_id = ".$_GET['idc'];
$sql = "SELECT * FROM EncarregadoDeEducacao WHERE ee_id = ee_id.inscricao where al_id = ".$_GET['idc'];
tables:
CREATE TABLE IF NOT EXISTS 'Inscricao' (
'insc_id' int(4) unsigned Not Null AUTO_INCREMENT,
'al_id' int(4) Not Null DEFAULT '0',
'ee_id' int(4) Not Null DEFAULT '0',
'obs_desc' varchar(250) Not Null DEFAULT 'Sem observacoes',
'prof_nome' varchar(50) Not Null DEFAULT '',
'insc_data' DATE Not Null DEFAULT '00-00-0000',
PRIMARY KEY ('insc_id')
) ENGINE=myisam DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS 'Aluno' (
'al_id' int(4) unsigned Not Null AUTO_INCREMENT,
'al_nome' varchar(50) Not Null DEFAULT '',
'al_idade' int(2) Not Null DEFAULT '0',
'al_data' DATE Not Null DEFAULT '00-00-0000',
'al_morada' varchar(80) Not Null DEFAULT '',
'al_escolaridade' int(2) Not Null DEFAULT '0',
'al_nomepai' varchar(50) Not Null DEFAULT '',
'al_nomemae' varchar(50) Not Null DEFAULT '',
'al_nomeensino' varchar(50) Not Null DEFAULT '',
'al_localensino' varchar(80) Not Null DEFAULT '',
'al_img' varchar(32) NOT NULL DEFAULT '',
'ocupacao' varchar(250) Not Null DEFAULT 'sem ocupacao de tempos livres',
'tra_simnao' varchar(250) Not Null DEFAULT 'nao',
'tra_desc' varchar(250) Not Null DEFAULT 'Sem Transporte',
PRIMARY KEY ('al_id')
) ENGINE=myisam DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
CREATE TABLE IF NOT EXISTS 'EncarregadoDeEducacao' (
'ee_id' int(4) unsigned Not Null AUTO_INCREMENT,
'ee_nome' varchar(50) Not Null DEFAULT '',
'ee_parentesco' varchar(10) Not Null DEFAULT '',
'ee_localtrab' varchar(80) Not Null DEFAULT '',
'ee_telemovel' int(9) Not Null DEFAULT 0,
'ee_telefone' int(9) Not Null DEFAULT 0,
'ee_urgencia' int(9) Not Null DEFAULT 0,
'ee_email' varchar(50) Not Null DEFAULT '',
PRIMARY KEY ('ee_id')
) ENGINE=myisam DEFAULT CHARSET=UTF8 AUTO_INCREMENT=1;
I need to select data from the 3 tables to list the data of the complete enrollment of the student (data of the 3 tables) for example inscription 1 with student 2 in charge of education 5 and the respective data of each of the 3.
If I try to put it in 3 select I know the error I wanted to know how to do what I want without error, thanks.