| | |
Please help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Mar 2008
Posts: 29
Reputation:
Solved Threads: 0
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;
}
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;
}
![]() |
Other Threads in the PHP Forum
- Previous Thread: Help with parse and undefined errors
- Next Thread: How to create rss.php file
Views: 417 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic ebooks echo email error file files folder form forms function functions google href htaccess html image include insert integration ip java javascript joomla jquery js limit link login loop mail mediawiki menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql stored structure subdomain syntax system table tutorial update updates upload url validation validator variable video web xml youtube





