Tema: Warning's
Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/10/2004, 12:05
Avatar de JuanKa
JuanKa
 
Fecha de Ingreso: septiembre-2004
Mensajes: 468
Antigüedad: 19 años, 7 meses
Puntos: 1
Warning's

Hola a todos cuando registro una cesta me sale estos warnings pero no tengo problema algunos ya que me registra muy bien en la tabla.

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/dinfopin/public_html/cesta.php on line 52

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/dinfopin/public_html/cesta.php on line 53

Warning: Cannot modify header information - headers already sent by (output started at /home/dinfopin/public_html/cesta.php:52) in /home/dinfopin/public_html/Php/config_cesta.php on line 25

Warning: Cannot modify header information - headers already sent by (output started at /home/dinfopin/public_html/cesta.php:52) in /home/dinfopin/public_html/Php/config_cesta.php on line 25

******************************
Dentro del Script cesta.php
******************************

...
function Anadir($itemId, $qty)
{
Linea 52 $resultado = mysql_query("select count(*) from cesta where cookieId = '" . GetCartId() . "' and cod_art = '$itemId'",$conectar);

Linea 5 $row = mysql_fetch_row($resultado);
$numRows = $row[0];

if($numRows == 0)
{
mysql_query("insert into cesta(cookieId, cod_art, can_art) values('" . GetCartId() . "', '$itemId', $qty)");
}
else
{
UpdateItem($itemId, $cantidad);
}
}
...



******************************
config_cesta.php
******************************
<?php
$dbhost = "localhost" ;
$dbuser = "root" ;
$db = "usuarios" ;
$conectar = mysql_connect($dbhost,$dbuser) ;
mysql_select_db($db,$conectar) ;

function GetCartId()
{
if(isset($_COOKIE["cartId"]))
{
return $_COOKIE["cartId"];
}
else
{
session_start();
setcookie("cartId", session_id(), time() + ((3600 * 24) * 30));
return session_id();
}
}
?>
Porque me sales esos Warnigs.

Gracias