Re: Problem in the returnvalue of a function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi  Bayu Susiloadhy,

thanks for your answer.

>>   function select_price($product_id,$quantity) {
>  --cut--
>>     return True;
>>    }
>  --cut--

in the meentime I change the code that not a boolevalue
was returned by the function.

$q is my querystring and $db is the selected database.

I insert the following:

   $db->query($q);
    $result=mysql_db_query($db,$q);

    while ($row = mysql_fetch_object($result))
    {
        $price = $row->product_price;
    }
    mysql_free_result($result);
    echo "\n";
    echo $q;              // to show the sql-statement in runtime - diagnostics
    echo "\n";
    return $price;


By executing it I get two warnings  both "this is not a valid Mysql-result
resort". The disliked lines are the begin of the while-loop and an the
mysql_free_result($result)-command.

How have I to change up the script to get the product_price related to the
price_group.

Regards,
Ruprecht


----------------------------------
Ruprecht Helms IT-Service und Softwareentwicklung

Tel/Fax.:      +49[0]7621 16 99 16
Homepage:  http://www.rheyn.de
email:          info@rheyn.de
----------------------------------

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux