function insertPregunta(Preguntas $p) { try { $insert = "INSERT INTO preguntas VALUES(null,'" . $p->getNombreCliente() . "', " . "'" . $p->getPregunta() . "','" . $p->getEmail() . "', " . "" . $p->getTelefonoContacto() . ");"; $query = mysql_query($insert); if ($query === FALSE) { die(mysql_error()); // TODO: better error handling } return $query; } catch (Exception $exc) { echo $exc->getTraceAsString(); } }