|
@@ 500-505 (lines=6) @@
|
| 497 |
|
FROM votes |
| 498 |
|
WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')"); |
| 499 |
|
|
| 500 |
|
if($result === false) |
| 501 |
|
{ |
| 502 |
|
$error = db_error(); |
| 503 |
|
echo $error; |
| 504 |
|
echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
| 505 |
|
} |
| 506 |
|
|
| 507 |
|
if($result->num_rows == 0) |
| 508 |
|
{ |
|
@@ 532-536 (lines=5) @@
|
| 529 |
|
$result = $db->query("INSERT INTO votes (device_uid, postId, type) |
| 530 |
|
VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')"); |
| 531 |
|
|
| 532 |
|
if($result === false){ |
| 533 |
|
$error = db_error(); |
| 534 |
|
echo $error; |
| 535 |
|
echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
| 536 |
|
} |
| 537 |
|
} |
| 538 |
|
|
| 539 |
|
function registerAccount(Location $location) { |
|
@@ 564-569 (lines=6) @@
|
| 561 |
|
"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
| 562 |
|
|
| 563 |
|
$success = TRUE; |
| 564 |
|
if($result === false){ |
| 565 |
|
$error = db_error(); |
| 566 |
|
echo $error; |
| 567 |
|
echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
| 568 |
|
$success = FALSE; |
| 569 |
|
} |
| 570 |
|
|
| 571 |
|
return $device_uid; |
| 572 |
|
} |