Ver Mensaje Individual
  #1 (permalink)  
Antiguo 13/08/2008, 08:54
Avatar de xxrandyxx
xxrandyxx
 
Fecha de Ingreso: abril-2008
Ubicación: En mi casa
Mensajes: 143
Antigüedad: 16 años
Puntos: 2
Ayuda para Pasar variables por URL

Hola gentita, tengo una duda, aca les dejo mi codigo que me genero el dreamweaver...

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); 
En donde tipejo es donde pongo en mi we www.miweb.com/stock.php?tipejo=con cinta

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 = %AND detalle = %s
pero la verdad no se, la cosa es que busco hacer eso

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 =(
__________________
Todos somos muchos, muchos somos pocos, pocos somos los que sabemos y no sabemos lo que no conocemos...

PericoteSucio