include("includes/config.php");
include("includes/funciones.php");
if(empty($_GET['idProducto']) or empty($_GET['imgActual']) ){
//no hay id
header ("Location: productos.htm");
exit;
}
else {
$cnx = conectar();
$res_imagen = mysql_query("SELECT pathImagen FROM tbimagen WHERE idProducto = '".$_GET['idProducto']."' AND idImagen = '".$_GET['imgActual']."'") or die(mysql_error());
$res_total = mysql_query("SELECT Count(*) AS total FROM tbimagen WHERE idProducto =".$_GET['idProducto'])or die(mysql_error());
if (mysql_num_rows($res_imagen) > 0 )
$imagen = mysql_fetch_array($res_imagen);
if (mysql_num_rows($res_total) > 0 )
$total = mysql_fetch_array($res_total);
mysql_close($cnx);// cerramos la conexión.
}
?>