| @@ 360-365 (lines=6) @@ | ||
| 357 | FROM votes |
|
| 358 | WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')"); |
|
| 359 | ||
| 360 | if($result === false) |
|
| 361 | { |
|
| 362 | $error = db_error(); |
|
| 363 | echo $error; |
|
| 364 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
|
| 365 | } |
|
| 366 | ||
| 367 | if($result->num_rows == 0) |
|
| 368 | { |
|
| @@ 392-396 (lines=5) @@ | ||
| 389 | $result = $db->query("INSERT INTO votes (device_uid, postId, type) |
|
| 390 | VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')"); |
|
| 391 | ||
| 392 | if($result === false){ |
|
| 393 | $error = db_error(); |
|
| 394 | echo $error; |
|
| 395 | echo "Adding Vote failed: (" . $result->errno . ") " . $result->error; |
|
| 396 | } |
|
| 397 | } |
|
| 398 | ||
| 399 | function registerAccount($location) { |
|
| @@ 424-429 (lines=6) @@ | ||
| 421 | "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') "); |
|
| 422 | ||
| 423 | $success = TRUE; |
|
| 424 | if($result === false){ |
|
| 425 | $error = db_error(); |
|
| 426 | echo $error; |
|
| 427 | echo "Adding account failed: (" . $result->errno . ") " . $result->error; |
|
| 428 | $success = FALSE; |
|
| 429 | } |
|
| 430 | ||
| 431 | return $device_uid; |
|
| 432 | } |
|