Technical Discussion
  >> Web Design / HTML / Web hosting Forum


Register (or login) on our website and you will not see this ad.


These posts have been archived and can no longer be replied to or modified.
  Print Thread
Standard User Taras
(eat-sleep-adslguide) Sat 03-Jul-10 12:50:37
Print Post

Currency change in php


[link to this post]
 
is it possible in php to do something like this

have 3 currency icons and if you clicked on it it would change to that currency ..

The currency is currently being pulled from a database

Text
1
23
$result = mysql_query( 'SELECT `tblpricing`.`annually`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =1) AND (`tblpricing`.`currency` =1) AND (`tblpricing`.`type` ="product"))'. ' LIMIT 0, 30 ') or die(mysql_error()); 
       $row = mysql_fetch_assoc($result);           echo $row['annually'];


so say if i changed

`tblpricing`.`currency` =1

to
`tblpricing`.`currency` = $currenceyselection


Can I use a button to change the value in $currenceyselection?

ps. I know i don't need the limit 0,30 smile

_____________________________________________
<randomness>
streaming music - your music - spotify
Everything websites.... soon
My Blog .......... here (still in dev mode)
Me twittering go add
Standard User deleted
(deleted) Sat 03-Jul-10 14:52:42
Print Post

Re: Currency change in php


[re: Taras] [link to this post]
 
yes.

PHP
1
23
$result = mysql_query( 'SELECT `tblpricing`.`annually`'. ' FROM tblpricing'. ' WHERE ((`tblpricing`.`relid` =1) AND (`tblpricing`.`currency` = '.$currenceyselection.') AND `tblpricing`.`type` ="product"))'. ' LIMIT 0, 30 ') or die(mysql_error());
$row = mysql_fetch_assoc($result); echo $row['annually'];


Remember to validate any input to prevent SQL injection attacks.

Edited by deleted (Sat 03-Jul-10 14:59:15)

  Print Thread

Jump to