dejo mi codigo para ver quien me ayudaria, me urge
Cita:
<?php include("encabezado.php"); ?>
<div STYLE="height: 120px; width: 620px; font-size: 30px; overflow: auto;">
<table width="200" align="center">
<td ><strong>Nombre</strong></td>
<td ><strong>Imagen</strong></td>
<?php
if(isset($_GET["submit"]) && isset($_GET["submit"]))
{
mysql_connect("localhost","root","") or die("No se ha podido conectar");
mysql_select_db("bd_sitio_artesanal") or die("Error al seleccionar la bd");
$search = $_GET["search"];
$keywords_array = explode(" ",$search);
$query = " SELECT * FROM artesanias WHERE Nombre LIKE '%".$keywords_array[0]."%'";
for($i = 1; $i< count($keywords_array); $i++)
{
$query .= " OR Nombre LIKE '%".$keywords_array[$i]."%'";
}
if($resource = mysql_query($query))
{
while ($row = mysql_fetch_assoc($resource))
{
$Nombre = $row["Nombre"];
?>
<tr>
<th scope="col">Busqueda</th>
</tr>
<td>
<?php echo $Nombre; ?>
</td>
<td>
<?php echo "<img src='../uploads/".$row['Foto']."'width='100' height='100'/>";
}
}
else{
echo "no se ha podido realizar la busqueda";
}
}
else
{
header("Location:form_buscar.php");
exit();
}
?>
</td>
</table>
</div>
<?php include("pie_pagina.php"); ?>
espero algien me ayude..... soy novato en PHP..apenas voy empezando <?php include("encabezado.php"); ?>
<div STYLE="height: 120px; width: 620px; font-size: 30px; overflow: auto;">
<table width="200" align="center">
<td ><strong>Nombre</strong></td>
<td ><strong>Imagen</strong></td>
<?php
if(isset($_GET["submit"]) && isset($_GET["submit"]))
{
mysql_connect("localhost","root","") or die("No se ha podido conectar");
mysql_select_db("bd_sitio_artesanal") or die("Error al seleccionar la bd");
$search = $_GET["search"];
$keywords_array = explode(" ",$search);
$query = " SELECT * FROM artesanias WHERE Nombre LIKE '%".$keywords_array[0]."%'";
for($i = 1; $i< count($keywords_array); $i++)
{
$query .= " OR Nombre LIKE '%".$keywords_array[$i]."%'";
}
if($resource = mysql_query($query))
{
while ($row = mysql_fetch_assoc($resource))
{
$Nombre = $row["Nombre"];
?>
<tr>
<th scope="col">Busqueda</th>
</tr>
<td>
<?php echo $Nombre; ?>
</td>
<td>
<?php echo "<img src='../uploads/".$row['Foto']."'width='100' height='100'/>";
}
}
else{
echo "no se ha podido realizar la busqueda";
}
}
else
{
header("Location:form_buscar.php");
exit();
}
?>
</td>
</table>
</div>
<?php include("pie_pagina.php"); ?>