CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 update variable on multiple pages with one button

Print topic Send  topic

Author Message
Bernd
Posted: 05/28/2004, 11:36 AM

Hi all,

need to figure out how to create a single page with one button on it that will, once clicked, update a variable on all the products.

Take the bookshop example of CCS. I've added an new filed to the products table called "pricep", created a new table called "exchange".

I now need to create a button on (prefrably the sdmin home page) that once clicked will change all the values in filed "price" of the products with the formula price=pricep*exch+1.1 this answer must be stored in field "price" for every product.

Any clues for me ?
Anothersledhead


Posts: 44
Posted: 05/28/2004, 12:32 PM

I am assuming that you want to modify prices dynamically to figure out exchange rates. Have the button or link set a cookie with your exchange rate. Dynamically modify your price through SQL code something to this effect ---- SELECT pricep( {exch}+1.1) AS price FROM products ---- make sure and retrieve the cookie that was saved when the button was clicked for this to work.

Just a thought!
View profile  Send private message
Georg
Posted: 05/28/2004, 12:35 PM

Yes for Exchange rastes is correct. Have the exchange rate in field "exchange" which is being updated daily by a provider, just need to "FORCE" the new changes to filed "price"
RonB

Posts: 228
Posted: 06/04/2004, 7:54 AM

Do you just want to update the prices as shown on the page or the actual prices in the database?

If you already store the exchange rate in the db yoou can use it in the sql statement when you select the data for the grid ie:

select product, (price * exchange +1.1) as price from products, exhange_tabel

That way you do not have to update all prices . As a plus, the database will do this faster then anything in php.
View profile  Send private message
Walter Kempees
Posted: 06/06/2004, 1:49 PM

this is a beauty, and the way to go!

"RonB" <RonB@forum.codecharge> schreef in bericht
news:540c08d0842f7f@news.codecharge.com...
> Do you just want to update the prices as shown on the page or the actual
prices
> in the database?
>
> If you already store the exchange rate in the db yoou can use it in the
sql
> statement when you select the data for the grid ie:
>
> select product, (price * exchange +1.1) as price from products,
exhange_tabel
>
> That way you do not have to update all prices . As a plus, the database
will do
> this faster then anything in php.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>


Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.