Browse code

Explicitly set MySQL into a more permissive mode like it used to be. Installation failed with the more modern strict mode.

Jeff Snider authored on 2016/08/28 13:47:37
Showing 1 changed files
... ...
@@ -11,6 +11,7 @@ function dbconnect($dbhost, $dbuser, $dbpass, $dbname ) {
11 11
 		die(_FATALERROR." "._NOTCONNECTED);
12 12
 	}
13 13
 	mysql_select_db($dbname, $mysql_access);
14
+	mysql_query("SET SESSION sql_mode = 'MYSQL40'");
14 15
 	return $mysql_access;
15 16
 }
16 17
 
Browse code

Initial uplad w/ php7 fixes

Rainer Volkrodt authored on 2016/03/12 15:54:02
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,69 @@
1
+<?php
2
+
3
+// Some DB functions 
4
+
5
+if(!function_exists("dbconnect")) { // just in case.  Some people seemed to be having an issue and this was the easiest fix.
6
+
7
+function dbconnect($dbhost, $dbuser, $dbpass, $dbname ) {
8
+	$mysql_access = mysql_connect($dbhost, $dbuser, $dbpass);
9
+	if(!$mysql_access) {
10
+		include(_BASEDIR."languages/en.php");
11
+		die(_FATALERROR." "._NOTCONNECTED);
12
+	}
13
+	mysql_select_db($dbname, $mysql_access);
14
+	return $mysql_access;
15
+}
16
+
17
+
18
+function dbquery($query) {
19
+	global $debug, $headerSent, $dbconnect;
20
+	if($debug  && $headerSent) echo "<!-- $query -->\n";
21
+	$result = mysql_query($query, $dbconnect) or accessDenied( _FATALERROR.(isADMIN ? "Query: ".$query."<br />Error: (".mysql_errno( ).") ".mysql_error( ) : ""));
22
+	return $result;
23
+}
24
+
25
+function dbnumrows($query) {
26
+	global $debug, $dbconnect;
27
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
28
+		echo "<!-- dbnumrows ".mysql_error( )." -->\n";
29
+	}
30
+	$query = mysql_num_rows($query);
31
+	return $query;
32
+}
33
+
34
+function dbassoc($query) {
35
+	global $debug, $dbconnect;
36
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
37
+		echo "<!-- dbassoc ".mysql_error( )." -->\n";
38
+	}
39
+	$query = mysql_fetch_assoc($query);
40
+	return $query;
41
+}
42
+
43
+function dbinsertid($tablename = 0) {
44
+	return mysql_insert_id( );
45
+}
46
+
47
+function dbrow($query) {
48
+	global $debug, $dbconnect;
49
+	if ($query === false && mysql_errno( ) > 0 && $debug) {
50
+		if($error) echo "<!-- dbrow ".mysql_error( )." -->\n";
51
+	}
52
+	$query = mysql_fetch_row($query);
53
+	return $query;
54
+}
55
+
56
+// Used to escape text being put into the database.
57
+function escapestring($str) {
58
+   if (!is_array($str)) return mysql_real_escape_string($str);
59
+   else return array_map('escapestring', $str);
60
+}
61
+
62
+function dbclose( ) {
63
+	global $dbconnect;
64
+	mysql_close($dbconnect);
65
+
66
+}
67
+// End DB functions
68
+}
69
+?>
0 70
\ No newline at end of file