Ver Mensaje Individual
  #10 (permalink)  
Antiguo 02/04/2012, 16:44
OwnerMap
 
Fecha de Ingreso: marzo-2012
Mensajes: 13
Antigüedad: 12 años
Puntos: 1
Respuesta: Editando un Buscador PHP & Mysql

uff ya tengo el sistema de busqueda, por fin ahora solo tengo la duda como darle diseño a las tablas? osea al resultado ? quiero acomodar cada campo, darle diseño para que se vea mejor.

Mi codigo:
Código PHP:
<!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 http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>busqueda en tabla</title>
<style type="text/css">
body,td,th {
    font-family: Calibri, "trebuchet MS", Arial, Verdana;
    font-size: 14px;
    color: #000;
    font-weight: bold;
    text-align: center;
}
a:link {
    color: #F00;
    font-weight: bold;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
}
a:hover {
    text-decoration: none;
}
a:active {
    text-decoration: none;
}
h1,h2,h3,h4,h5,h6 {
    font-weight: bold;
    text-align: center;
}
h1 {
    font-size: 18px;
    color: #000;
}
#form1 table tr td {
    text-align: center;
}
</style>
</head>
<?
 
//modifica estas variables segn tu servidor de MySQL
$bd_servidor "localhost";
$bd_usuario "root";
$bd_contrasenya "";
$bd_bdname "eromexpresscargo";
 
$bd_tabla "rastreo"// Tabla donde se haran las busquedas
// Conexin y seleccin de la base de datos
$link mysql_connect($bd_servidor,$bd_usuario,$bd_contrasenya);
mysql_select_db($bd_bdname,$link);
 
?>
<body>
<table width="740" height="150" border="0" align="center" cellpadding="0" cellspacing="0">
<p>
<tr>
  <td height="41"><h2>Resumen de Rastreo</h2></td>
</tr>
<td height="38"><form id="form1" name="form1" method="post" action="">
<table width="740" border="1" align="left" cellpadding="0" cellspacing="0">
<p><h2></h2></p>
<tr>
 

<td width="493">Numero de Guia:
<label for="palabra"></label>
<input type="text" name="palabra" id="palabra" /> 
 <input type="submit" name="enviar" id="enviar" value="Enviar" /></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td align="center" valign="top"><p align="left"><strong>Resultados :</strong></p>
  <p align="left">
    <?
////////////////////////////
// Proceso del Formulario
///////////////////////////
if(isset($_POST['enviar'])) {
// Solo se ejecuta si se ha enviado el formulario

$query "select * from $bd_tabla where guia
LIKE '{$_POST['palabra']}'"
;
//echo $query;
$result mysql_query($query,$link);
$found false// Si el query ha devuelto algo pondra true esta variable
while ($fila mysql_fetch_array($result)) {
$found true;
echo 
"<p>";
echo 
$fila["guia"];
    echo 
$fila["fecha"];
    echo 
$fila["mediodeenvio"];

}
if(!
$found) {
echo 
"No se encontro la palabra introducida";
}
}
?>
  </p></td>
</tr>
</table>
</body>
</html>