Forums

This topic is locked

Getting Results into a Variable

Posted 12 Nov 2007 23:25:59
1
has voted
12 Nov 2007 23:25:59 Paul Grimes posted:
Hello, I hope somebody can help me.
I have a database in MySQL. I have made a search page which a user enters a Job_No and it returns a results page with all the jobs associated to the inputted Job_No. I have then made a link on the descriptions, clicking on the required link opens a detail page which shows the following from the following Tables
Materials (Table) Quantity, amount used, unit price, additional cost, job no.
Labour (Table) Engineer, paying rate per hour, amount of hours, job no.

I have defined a record set for the Material which is SELECT Quantity * Unit_Price
FROM `material`
WHERE Job_No = 'colname'
The colname comes from a variable, $_GET['recordID'] from the previous page.

This record set puts the result into a dynamic table, so if quantity = 1 and unit price = 10 a figure of 10 is put into the Dynamic materials Table.

There is an Additional cost field which is displayed in the Materials table, this is a % such as 5%, 10% or 20%.

I want to get the Value from the Dynamic materials table i.e. 10 in this case, and add the value which is in the additional cost field in the materials table. Can somebody please point me in the right direction?

CHeers
Paul.

Replies

Replied 14 Nov 2007 13:03:00
14 Nov 2007 13:03:00 Paul Grimes replied:
OK, I have looked at MyPHPAdmin, and it works there, so I need to get the Additional_Cost from the results table, and store it in a variable, but not too sure where to start .
ANy help please?

Reply to this topic