agregar categorias a traves de un buscador
Publicado por daniel (50 intervenciones) el 16/09/2014 02:15:49
hola a todos los que me lean... tengo el siguiente problema (uso php y mysql)
hice un buscador de categorias, pero despues que agrego la pelicula solo aparece en una categoria...
se me ocurre que puede ser por que hay que recorrer las categorias con un foreach o algo asi...
aqui partes de los codigo
(buscador2.php)
-------------------
(categorias.php) (no incluì el codigo del paginador)
categorias.php : los -echo-
----------------
mi web es http://pelislatino.host56.com
POR FAVOR, AYUDA
PD: no soy muy experto en php.
hice un buscador de categorias, pero despues que agrego la pelicula solo aparece en una categoria...
se me ocurre que puede ser por que hay que recorrer las categorias con un foreach o algo asi...
aqui partes de los codigo
(buscador2.php)
1
2
3
4
<form id="form2" name="form2" method="get" action="categorias.php">
<label for="search"></label>
<input type="text" name="search" id="search" />
</form>
-------------------
(categorias.php) (no incluì el codigo del paginador)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$colname_cats = "-1";
if (isset($_GET['search'])) {
$colname_cats = $_GET['search'];
}
mysql_select_db($database_pelislatinofinal, $pelislatinofinal);
$query_cats = sprintf('SELECT * FROM tbltodaslaspelis WHERE Info LIKE %s ORDER BY idPelicula DESC LIMIT '.(($paginacion->get_page() - 1) * $reg_por_paginas). ',' .$reg_por_paginas, GetSQLValueString("%" . $colname_cats . "%", "text"));
$cats = mysql_query($query_cats, $pelislatinofinal) or die(mysql_error());
$row_cats = mysql_fetch_assoc($cats);
$totalRows_cats = mysql_num_rows($cats);
?>
categorias.php : los -echo-
1
2
3
4
5
<?php while($row_cats = mysql_fetch_array($cats)){ ?>
<div class="resultadoproductos">
<div class="producto"><a href="ver_todas.php?todas=<?php echo $row_cats['idPelicula']; ?>"><img src="exadmin/documentos/peliculas/<?php echo $row_cats['Imagen']; ?>" width="170" height="240" /></a> <?php echo $row_cats['Nombre']; ?></div>
</div>
<?php } ?>
mi web es http://pelislatino.host56.com
POR FAVOR, AYUDA
PD: no soy muy experto en php.
Valora esta pregunta


0