Iam problem with this :
Supplied argument is not a valid MySQL result resource in c:\apache\htdocs\cd_shop\funkcie_s_databazou.php on line 1039
this is code:
function zrataj_cenu($kosik)
//funkcia pocitajuca vyslednu sumu vsetkych poloziek v nakupnom kosiku
{
$cena = 0.0;
if(is_array($kosik))
{
$conn = db_connect();
foreach($kosik as $EAN_kod => $qty)
{
// $query = "select cena from albumy where EAN_kod='$EAN_kod'";
//$query = "select cena from albumy where EAN_kod='$EAN_kod'";
//$query1 = "select cena from ciste_media where EAN_kod='$EAN_kod'";
//$result=$query+$query1;
// $result = mysql_query($query);
if (!$result = vyber_detaily_cd2($EAN_kod))
$result = vyber_detaily_media2($EAN_kod);
if ($result)
{
$cena_polozky = mysql_result($result, 0, "cena"); [B]this is line 1039[/B]
$cena +=$cena_polozky*$qty;
}
}
}
return $cena;
}