Code Duplication    Length = 6-6 lines in 3 locations

php/JodelAccount.php 3 locations

@@ 406-411 (lines=6) @@
403
404
        $result = $db->query("SELECT id FROM votes WHERE (postId = '" . $postId . "' AND device_uid = '" . $this->deviceUid . "')");
405
        
406
        if($result === false)
407
        {
408
            $error = db_error();
409
            echo $error;
410
            error_log("Adding Vote failed: (" . $result->errno . ") " . $result->error);
411
        }
412
413
        if($result->num_rows == 0)
414
        {
@@ 438-443 (lines=6) @@
435
        $result = $db->query("INSERT INTO votes (device_uid, postId, type)
436
                        VALUES ('" . $this->deviceUid . "','" . $postId . "','" . $voteType . "')");
437
        
438
        if($result === false){
439
                $error = db_error();
440
                echo $error;
441
                echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
442
        }       
443
    }
444
445
    function registerAccount($location) {
446
        $accountCreator = new CreateUser();
@@ 470-475 (lines=6) @@
467
                        "','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
468
469
        $success = TRUE;
470
        if($result === false){
471
                $error = db_error();
472
                echo $error;
473
                echo "Adding account failed: (" . $result->errno . ") " . $result->error;
474
                $success = FALSE;
475
        }   
476
        
477
        return $device_uid;
478
    }