-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpointsajaxsubmit.php
More file actions
26 lines (21 loc) · 927 Bytes
/
pointsajaxsubmit.php
File metadata and controls
26 lines (21 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php
$host = "databaseinstance.cmpvv7vrynza.us-west-2.rds.amazonaws.com";
$user = "arregoitiaJ1";
$pass = "Iamiamiam123";
$databaseName = "earthlinks";
$tableName = "Users";
//--------------------------------------------------------------------------
// 1) Connect to mysql database
//--------------------------------------------------------------------------
include 'DB.php';
$con = mysql_connect($host,$user,$pass);
$dbs = mysql_select_db($databaseName, $con);
//--------------------------------------------------------------------------
// 2) Post data to database
//--------------------------------------------------------------------------
$points = $_POST['points'];
$userid = $_POST['userid'];
$query = mysql_query("UPDATE $tableName set Points=Points + $points WHERE ID = '".intval($userid)."'");
echo "Points added successfully";
mysql_close($con); // Connection Closed
?>