From 7faab9c40d199c032562279be6db98b632dc7ef6 Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Mon, 4 Jul 2011 01:38:16 +0000
Subject: [PATCH] Missing rows should be created

---
 inc/fix_user_points.php | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/inc/fix_user_points.php b/inc/fix_user_points.php
index d7d1622356..addaae100c 100644
--- a/inc/fix_user_points.php
+++ b/inc/fix_user_points.php
@@ -70,6 +70,17 @@ if (!SQL_HASZERONUMS($result)) {
 						$row[$column],
 						$row['userid']
 					), __FILE__, __LINE__);
+
+				// Nothing has been updated?
+				if (SQL_HASZEROAFFECTED()) {
+					// Then insert it
+					SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_points` (`userid`,`ref_depth`,`%s`) VALUES(%s,NULL,%s)",
+						array(
+							$column,
+							$row['userid'],
+							$row[$column]
+						), __FILE__, __LINE__);
+				} // END - if
 			} // END - if
 		} // END - foreach
 	} // END - while
-- 
2.39.5