|
@@ 491-496 (lines=6) @@
|
| 488 |
|
FROM votes |
| 489 |
|
WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')"); |
| 490 |
|
|
| 491 |
|
if($result === false) |
| 492 |
|
{ |
| 493 |
|
$error = db_error(); |
| 494 |
|
echo $error; |
| 495 |
|
echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
| 496 |
|
} |
| 497 |
|
|
| 498 |
|
if($result->num_rows == 0) |
| 499 |
|
{ |
|
@@ 523-527 (lines=5) @@
|
| 520 |
|
$result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 521 |
|
VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')"); |
| 522 |
|
|
| 523 |
|
if($result === false){ |
| 524 |
|
$error = db_error(); |
| 525 |
|
echo $error; |
| 526 |
|
echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
| 527 |
|
} |
| 528 |
|
} |
| 529 |
|
|
| 530 |
|
function registerAccount(Location $location) { |
|
@@ 555-560 (lines=6) @@
|
| 552 |
|
"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 553 |
|
|
| 554 |
|
$success = TRUE; |
| 555 |
|
if($result === false){ |
| 556 |
|
$error = db_error(); |
| 557 |
|
echo $error; |
| 558 |
|
echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
| 559 |
|
$success = FALSE; |
| 560 |
|
} |
| 561 |
|
|
| 562 |
|
return $device_uid; |
| 563 |
|
} |