Please help

Reply

Join Date: Mar 2008
Posts: 29
Reputation: stalk is an unknown quantity at this point 
Solved Threads: 0
stalk stalk is offline Offline
Light Poster

Please help

 
0
  #1
Mar 13th, 2008
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"); this is line 1039
$cena +=$cena_polozky*$qty;
}
}
}
return $cena;
}
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 121
Reputation: Auzzie is an unknown quantity at this point 
Solved Threads: 16
Auzzie Auzzie is offline Offline
Junior Poster

Re: Please help

 
0
  #2
Mar 13th, 2008
Correct me if i am wrong but i thought mysql_result only accepted 2 parameters, not 3
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 29
Reputation: stalk is an unknown quantity at this point 
Solved Threads: 0
stalk stalk is offline Offline
Light Poster

Re: Please help

 
0
  #3
Mar 13th, 2008
No it accept 3, but problem is somewhere in array, because I need get to variable result array cena from two database tables.
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 29
Reputation: stalk is an unknown quantity at this point 
Solved Threads: 0
stalk stalk is offline Offline
Light Poster

Re: Please help

 
0
  #4
Mar 13th, 2008
if (!$result = vyber_detaily_cd2($EAN_kod))
$result = vyber_detaily_media2($EAN_kod);

this function select me array: cena of product in shoping basket using its primary key:EAN_kod and select it from two tables. And I must get final price in variable $cena
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum


Views: 417 | Replies: 3
Thread Tools Search this Thread



Tag cloud for PHP
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC