Re: Problem in the returnvalue of a function
| From: | Ruprecht Helms | Date: | Tue, 21 Jan 2003 11:45:09 +0000 |
| Subject: | Re: Problem in the returnvalue of a function | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25000@lists.php.net to get a copy of this message | ||
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
----------------------------------