Ver Mensaje Individual
  #21 (permalink)  
Antiguo 27/06/2008, 07:00
Avatar de T4ke0veR
T4ke0veR
 
Fecha de Ingreso: agosto-2007
Ubicación: Quito - Ecuador
Mensajes: 1.720
Antigüedad: 16 años, 8 meses
Puntos: 28
Respuesta: Contador por click no cuenta!!!

muy extraño con todos esos codigos sigue en el mismo error... al colocar or die(mysql_error()); ... me dice Query was empty....

Código PHP:
<?php require_once('Connections/multisillas.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_Recordset1 "-1";
if (isset(
$_GET['id'])) {
  
$colname_Recordset1 $_GET['id'];
}
mysql_select_db($database_multisillas$multisillas);
$query_Recordset1 sprintf("SELECT * FROM productos WHERE id = %s"GetSQLValueString($colname_Recordset1"int"));
$Recordset1 mysql_query($query_Recordset1$multisillas) or die(mysql_error());
$row_Recordset1 mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 mysql_num_rows($Recordset1);

$producto_ID $_GET['id'];

$sqlQuery mysql_query("SELECT * FROM productos
                         WHERE id = '$producto_ID'"
)
                         or die(
mysql_error());
$row mysql_fetch_array($sqlQuery);

if(!empty(
$producto_ID)){
    
$hitIP $_SERVER['REMOTE_ADDR'];
    
$hitProductoID $row['id'];    
    
$date gettimeofday ();
    
$sqlInsert mysql_query("INSERT INTO hits (hitIP, hitProductoID)
                              VALUES ('$hitIP', '$hitProductoID')"
)
    or die(
mysql_error());
}

$sqlHitsQuery mysql_query("SELECT * FROM hits
                             WHERE hitProductoID = '$producto_ID'"
)
                             or die(
mysql_error());
$hits mysql_num_rows($sqlHitsQuery);

$scomprobarIP "SELECT hitIP FROM hits where hitIP = 'xxx.xxx.xxx.xxx'" ;  
$res mysql_query($comprobarIP) or die(mysql_error());   

if (
mysql_num_rows($res) == 0); {   

$suma = (hitTotal 1);

mysql_query("UPDATE hits SET hitTotal = '$suma'") or die(mysql_error()); 
}  

?>
__________________
Diseño gráfico, Web, imagen corporativa, publicidad ...