Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use table info as variables

Status
Not open for further replies.

elentz

Technical User
Jan 9, 2007
81
US
Can someone give me an example? I have an update query that uses two manual inputs from a PHP page. I put in the recordid and the multiplier and it changes pricing for all the products by the second amount. Ths issue is that I have 13 records (and it could grow) and it is getting tiresome to manually put in the info. Here's my query:

$query="INSERT INTO
vtiger_pricebookproductrel
( pricebookid
, productid
, listprice )
select (".$fieldvalue1.")
, productid
, (unit_price *.769) * (".$fieldvalue2.")
from vtiger_products";

$fieldvalue1 and $fieldvalue2 would be the variables that I need to use from a different table. The table only has two fields, recordid and markup.

Ideally I would like to setup a PHP page to do this with a button and some sort of status , but that is icing on the cake, for now getting the query to work would be great. Any advice is appreciated
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top