This topic is locked

INSERT INTO

1/4/2008 9:49:44 PM
PHPRunner General questions
S
swanside author

Hello, I have been doing alot of reading. To get over my problem of trying to create an invoice.
I found that if I run this script in MySQL Query Browser

INSERT INTO material

(Matsubtotal)

SELECT Unit_Price*Quantity

FROM material

where Job_No = 1


It puts the calculated value of the SELECT Unit_Price*Quantity into Matsubtotal field on the materials Table.
If I can do this for all the products in the materials, it not only stores useful information in the database, but, I can now create a custom view with the aid of a join to get all the precalculated fields onto an invoice page, but, When I try it, PHPRunner crashes.

Any help please?

Thanks

Paul.

J
Jane 1/9/2008

Paul,
you can't use INSERT statement on the Edit SQL query, only SELECT statement.
To update database execute your INSERT or UPDATE queries in the database directly or use events for this purpose.

S
swanside author 1/13/2008

Thanks Jane.