
28/11/2004, 11:11
|
| | Fecha de Ingreso: octubre-2004 Ubicación: Ibague
Mensajes: 348
Antigüedad: 20 años, 5 meses Puntos: 2 | |
Aqui va el codigo, alguien mepdoria decir que esta mal? muchas graciaspor su ayuda.
<html>
<head>
<title>Services</title>
</head>
<body bgcolor=white onload="document.search.company.focus();">
<form action=searchservices.php method=GET name=search>
Narrow your search
<table>
<tr>
<td>Search<td><input type=text name=company size=25 maxlength=100 value="<?php echo "$company";?>">
<td><input type=submit value=go><td>
</tr>
</table>
</form>
<?php
include("settings.php3");
$db = mysql_connect("$dbhost", "$dblogin", "$dbpass");
mysql_select_db("$dbname",$db);
$result = mysql_query("SELECT * FROM services WHERE company LIKE '%$company%' or address LIKE '%$company%' or city LIKE '%$company%' or phone LIKE '%$company%' or keywords LIKE '%$company%' ORDER BY picture DESC",$db);
$alternate = "2";
$num_rows = mysql_num_rows($result);
echo "<table width=100%><tr><td><b><font size=+2>Services</font></td><td align=right>showing $num_rows results</td></tr></table><hr>";
while ($row = mysql_fetch_array($result)) {
$field1 = $row["company"];
$field2 = $row["address"];
$field3 = $row["city"];
$field4 = $row["state"];
$field7 = $row["zip"];
$field5 = $row["phone"];
$field6 = $row["picture"];
if ($field6 == "")
{
$alternate = "2";
}
$centerthis = "<td align=center width=50%>$field6</center></td>";
if ($field6 == "")
{
$centerthis = "<td> </td>";
}
if ($alternate == "1") {
$color = "<table width=100%><tr><td align=center>$field6</center></td><td align=left width=50%><center><font size='+1'><b>$field1</b><br>$field2<br>$field3, $field4 $field7<br>$field5</font></td></tr></table><hr>";
$alternate = "2";
}
else {
$color = "<table width=100%><tr><td align=center><center><font size='+1'><b>$field1</b><br>$field2<br>$field3, $field4 $field7<br>$field5</font></td>$centerthis</tr></table><hr>";
$alternate = "1";
}
echo "$color";
}
echo "</table>";
?>
<hr>
<center>
</center>
</body>
</html> |