
February 10th, 2000, 07:53 PM
|
|
Junior Member
|
|
Join Date: Feb 2000
Location: Laurens, SC ,US
Posts: 20
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
I know this must be something incredibly simple but since I don't know what that simple thing is,...
I have created a table with a column "Price" defined as Decimal(10,2). There are two records for articles with prices of 99.95 and 14.95.
Within PHP I have the following lines:
$resulta = mysql_query("Select price from shop where article = '4'");
if (!$resulta) {echo "An error occurred in query.n",exit;}
echo "Result A price for article 4 is $resulta <br>";
$resultb = mysql_query("Select price from shop where article = '5'");
if (!$resultb) {echo "An error occurred in query.n",exit;}
echo "Result B price for article 5 is $resultb<br>";
$resultc = $resulta + $resultb;
The page results are:
Result A price for article 4 is 2
Result B price for article 5 is 3
Value in this field is 5
While in mySQL via telnet the command "Select * from TABLE;" returns the correct results.
Where have I gone astray? I have also tried integer and float.
------------------
Thanks for the help.
ebryan@lumenet.com
|