Skip to content

Instantly share code, notes, and snippets.

Created April 15, 2016 13:29
Show Gist options
  • Save anonymous/e856afe5cc37bcb261eb37b18f8b7d20 to your computer and use it in GitHub Desktop.
Save anonymous/e856afe5cc37bcb261eb37b18f8b7d20 to your computer and use it in GitHub Desktop.
if(isset($_POST['pRate'], $_POST['dRate'], $_POST['eRate']))
{
$pounds= $_POST['pRate'];
$dollars= $_POST['dRate'];
$euros= $_POST['eRate'];
$_pounds= mysql_real_escape_string($pounds);
$_dollars= mysql_real_escape_string($dollars);
$_euros= mysql_real_escape_string($euros);
$sql= ("UPDATE Exchange
SET poundRate= $_pounds,
dollarRate= $_dollars,
euroRate= $_euros");
$result= mysql_query($sql);
}
if (isset($_POST['pRate'], $_POST['dRate'])) {
$sql= ("UPDATE Exchange
SET dollarRate= $_dollars,
poundRate= $_pounds");
$result= mysql_query($sql);
}
if (isset($_POST['dRate'], $_POST['eRate'])) {
$sql= ("UPDATE Exchange
SET dollarRate= $_dollars,
euroRate= $_euros");
$result= mysql_query($sql);
}
if (isset($_POST['eRate'], $_POST['pRate'])) {
$sql= ("UPDATE Exchange
SET poundRate= $_pounds,
euroRate= $_euros");
$result= mysql_query($sql);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment