<?Php
$servidor = "localhost";
$usuario_bd = "root";
$password_bd = "";
$basedatos = "empresa";
if (!$conexion)
{
echo "Error conectando a la base de datos.";
}
if (!$resultado)
{
echo "Error seleccionando la base de datos.";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Mantenimientos y Servicios</title>
<style type="text/css">
.style2 {
background-color: #3366CC;
}
</style>
</head>
<body>
<div id="layer1" style="position: absolute; width: 459px; height: 427px; z-index: 1; left: 10px; top: 15px; visibility: visible;" class="style2">
<form method="post" action="mantyserv.php" style="height: 206px">
<h1 align="center">Mantenimiento y Servicios</h1>
<table style="width: 93%; height: 147px;">
<tr>
<td style="width: 148px; height: 45px;">Código</td>
<td style="height: 45px">
<select name="sel_vend" id="sel_vend" style="width: 140px">
<?php
// $c = 0;
$consulta= "SELECT * FROM empleados ";
echo " <option value=\"".$linea[0]."\">".$linea[1]."</option>\n";
}
?>
</select> </td>
</tr>
<tr>
<td style="width: 148px; height: 45px;">Tipo de Mantenimiento</td>
<td style="height: 45px"><select multiple name ="tmant" style="width: 133px">
<option>Limpieza</option>
<option>Completo</option>
<option>Sistema</option>
<option>Otro</option>
</select></td>
</tr>
<tr>
<td style="width: 148px">Asignar Técnico</td>
<td>
<select name="sel_vend" id="sel_vend2" style="width: 133px; height: 18px;">
<?php
// $c = 0;
$consulta= "SELECT * FROM empleados where cargo='Tecnico'";
echo " <option value=\"".$linea[0]."\">".$linea[4]."</option>\n";
}
?>
</select>
</td>
</tr>
<tr>
<td style="width: 148px">Valor Asignado $</td>
<td><input name="valor" style="width: 133px" type="text" /></td>
</tr>
</table>
<p>Ingrese sus dudas o Notas</p>
<textarea name="notes" style="width: 404px; height: 69px"></textarea>
<input name="Submit1" type="submit" value="Enviar" />
<input name="Reset1" type="reset" value="Limpiar Campos" />
</form>
</div>
</body>
</html>
<?php
$conexion=mysql_connect("localhost","root","") or
die("ha ocurrido un error en la conexion"); mysql_select_db("empresa",$conexion) or
die("no se ha podido seleccionar la base de datos"); mysql_query("insert into mantyserv(sel_vend,tmant,sel_vend2,valor,notes) values('$_REQUEST[sel_vend]','$_REQUEST[tmant]','$_REQUEST[sel_vend2]','$_REQUEST[valor]','$_REQUEST[notes]')", $conexion) or
die ("error al registrar datos"); echo "<h1>Registro de Datos</h1>";
printf("<a href= inicio.php>Volver al Inicio</a>");
?>
ahi esta mejor el codigo
el error que te dice es el que vos pusiste???, osea "Error conectando a la base de datos".
saludos