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
	{
@@ 319-323 (lines=5) @@
316
	$result = $db->query("INSERT INTO votes (device_uid, postId)
317
					VALUES ('" . $device_uid . "','" . $postId . "') ");
318
	
319
	if($result === false){
320
			$error = db_error();
321
			echo $error;
322
			echo "Adding Vote failed: (" . $result->errno . ") " . $result->error;
323
	}	
324
	
325
}
326
@@ 352-357 (lines=6) @@
349
					"','" . $device_uid . "','" . $name . "','" . $lat . "','" . $lng . "') ");
350
351
	$success = TRUE;
352
	if($result === false){
353
			$error = db_error();
354
			echo $error;
355
			echo "Adding account failed: (" . $result->errno . ") " . $result->error;
356
			$success = FALSE;
357
	}	
358
	
359
	return $device_uid;
360
}