SELECT 
 `l`.*, 
 `f`.`ID` AS `id_form`, 
 `t`.`ID` AS `id_text` 

FROM 
 `lead` AS `l` 
LEFT JOIN
 `form` AS `f` ON `f`.`name` = `l`.`form`  
LEFT JOIN
 `text` AS `t` ON `t`.`name` = `l`.`form`    

WHERE 
  `l`.`ID` = :ID