Here is the code:
$getvalue = "SELECT value FROM $stock WHERE id = '$time'"; $value = mysql_query($getvalue); $balance=$quantity*$value; echo $balance; echo $value;
The output of this code is the following:
20Resource id #2
This would lead me to believe that the value $balance is returned as '20' and the value $value is returned as 'Resource id #2'. Now, I'm not sure why this is happening as I'm sure the table that is being accessed is fine.
The query works as follows:
$stock = GOOG
I have a table named 'GOOG' which has an 'id' field that is auto incremented by the number of rows. I have two rows, and a value within each. So, the query should go to the field 'value' and pick up the number within that field that corresponds to the value $time. I'm unsure of what 'Resource id #2' means, so I cannot even begin to determine the problem.
Thanks for the help,