Código PHP:
<?php require_once('../../Connections/heaterco_db.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$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_rs_rtc_1_35 = "-1";
if (isset($_GET['tipejo'])) {
$colname_rs_rtc_1_35 = $_GET['tipejo'];
}
mysql_select_db($database_heaterco_db, $heaterco_db);
$query_rs_rtc_1_35 = sprintf("SELECT * FROM resist_tp_cartucho WHERE tipo = %s", GetSQLValueString($colname_rs_rtc_1_35, "text"));
$rs_rtc_1_35 = mysql_query($query_rs_rtc_1_35, $heaterco_db) or die(mysql_error());
$row_rs_rtc_1_35 = mysql_fetch_assoc($rs_rtc_1_35);
$totalRows_rs_rtc_1_35 = mysql_num_rows($rs_rtc_1_35);
?>
Como veo el codigo que se encarga de que se genere para pasar la variable por la url es esta
Código PHP:
$colname_rs_rtc_1_35 = "-1";
if (isset($_GET['tipejo'])) {
$colname_rs_rtc_1_35 = $_GET['tipejo'];
}
mysql_select_db($database_heaterco_db, $heaterco_db);
$query_rs_rtc_1_35 = sprintf("SELECT * FROM resist_tp_cartucho WHERE tipo = %s", GetSQLValueString($colname_rs_rtc_1_35, "text"));
$rs_rtc_1_35 = mysql_query($query_rs_rtc_1_35, $heaterco_db) or die(mysql_error());
$row_rs_rtc_1_35 = mysql_fetch_assoc($rs_rtc_1_35);
$totalRows_rs_rtc_1_35 = mysql_num_rows($rs_rtc_1_35);
y me filtra todos los que dicen con cinta mediante el tipo WHERE tipo = %s, pero quiero hacer mas filtros y sumarlos, decian que era asi
Código PHP:
WHERE (tipo = %s AND detalle = %s)
www. miweb.com/stock?tipejo=con cinta&detalle=rojo&forma=cuadrado+redondo
lo que me funciona ahorita es asi www.miweb .com?tipejo=con cinta pero solo sale con cinta pero si quiero poner sin cinta me sale solo los que tienen cinta, queria sumarlos ?tipejo=con cinta+cinta para que me salieran todos pero nose como hacerlo
AYUDA PLEASE =(
