Code Duplication    Length = 5-6 lines in 3 locations

php/jodel-web.php 3 locations

@@ 291-296 (lines=6) @@
288
						  FROM votes
289
						  WHERE (postId = '" . $postId . "' AND device_uid = '" . $deviceUid . "')");
290
	
291
	if($result === false)
292
	{
293
		$error = db_error();
294
		echo $error;
295
		echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
296
	}
297
298
	if($result->num_rows == 0)
299
	{
@@ 355-360 (lines=6) @@
352
					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
353
354
	$success = TRUE;
355
	if($result === false){
356
			$error = db_error();
357
			echo $error;
358
			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
359
			$success = FALSE;
360
	}	
361
	
362
	return $device_uid;
363
}
@@ 323-327 (lines=5) @@
320
	$result = $db->query("INSERT INTO votes (device_uid, postId, type)
321
					VALUES ('" . $device_uid . "','" . $postId . "','" . $voteType . "')");
322
	
323
	if($result === false){
324
			$error = db_error();
325
			echo $error;
326
			echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
327
	}		
328
}
329
330
function registerAccount(Location $location) {