Skip to content
This repository
Browse code

Integrated commit - ratnayake@bbb9926

  • Loading branch information...
commit b3da0605724d05d05e6a2fea17e4f0fbe464130b 1 parent 6dad6bb
jv2222 authored October 15, 2012
3  mssql/ez_sql_mssql.php
@@ -382,6 +382,3 @@ function ConvertMySqlToMSSql($query)
382 382
 
383 383
 
384 384
 	}
385  
-
386  
-
387  
-?>
2  oracle8_9/ez_sql_oracle8_9.php
@@ -270,5 +270,3 @@ function query($query)
270 270
 		}
271 271
 
272 272
 	}
273  
-
274  
-?>
28  pdo/ez_sql_pdo.php
@@ -36,7 +36,7 @@ class ezSQL_pdo extends ezSQLcore
36 36
 		*  same time as initialising the ezSQL_sqlite class
37 37
 		*/
38 38
 
39  
-		function ezSQL_pdo($dsn='', $user='', $password='')
  39
+		function ezSQL_pdo($dsn='', $user='', $password='', $ssl=array())
40 40
 		{
41 41
 			// Turn on track errors 
42 42
 			ini_set('track_errors',1);
@@ -51,7 +51,7 @@ function ezSQL_pdo($dsn='', $user='', $password='')
51 51
 		*  Try to connect to SQLite database server
52 52
 		*/
53 53
 
54  
-		function connect($dsn='', $user='', $password='')
  54
+		function connect($dsn='', $user='', $password='', $ssl=array())
55 55
 		{
56 56
 			global $ezsql_pdo_str; $return_val = false;
57 57
 			
@@ -65,13 +65,21 @@ function connect($dsn='', $user='', $password='')
65 65
 			// Establish PDO connection
66 66
 			try 
67 67
 			{
68  
-    			$this->dbh = new PDO($dsn, $user, $password);
69  
-    			$return_val = true;
  68
+				if(!empty($ssl))
  69
+				{
  70
+					$this->dbh = new PDO($dsn, $user, $password, $ssl);
  71
+				}
  72
+				else
  73
+				{
  74
+					$this->dbh = new PDO($dsn, $user, $password);
  75
+				}
  76
+				
  77
+				$return_val = true;
70 78
 			} 
71 79
 			catch (PDOException $e) 
72 80
 			{
73 81
 				$this->register_error($e->getMessage());
74  
-    			$this->show_errors ? trigger_error($e->getMessage(),E_USER_WARNING) : null;
  82
+				$this->show_errors ? trigger_error($e->getMessage(),E_USER_WARNING) : null;
75 83
 			}
76 84
 
77 85
 			return $return_val;			
@@ -83,7 +91,7 @@ function connect($dsn='', $user='', $password='')
83 91
 		*  but for the sake of consistency it has been included
84 92
 		*/
85 93
 
86  
-		function quick_connect($dsn='', $user='', $password='')
  94
+		function quick_connect($dsn='', $user='', $password='', $ssl=array())
87 95
 		{
88 96
 			return $this->connect($dsn, $user, $password);
89 97
 		}
@@ -93,7 +101,7 @@ function quick_connect($dsn='', $user='', $password='')
93 101
 		*  once again, function included for the sake of consistency
94 102
 		*/
95 103
 
96  
-		function select($dsn='', $user='', $password='')
  104
+		function select($dsn='', $user='', $password='', $ssl=array())
97 105
 		{
98 106
 			return $this->connect($dsn, $user, $password);
99 107
 		}
@@ -244,10 +252,12 @@ function query($query)
244 252
 				
245 253
 				for ( $i=0 ; $i < $col_count ; $i++ )
246 254
 				{
  255
+					$this->col_info[$i] = new stdClass();
  256
+					
247 257
 					if ( $meta = $sth->getColumnMeta($i) )
248 258
 					{					
249 259
 						$this->col_info[$i]->name =  $meta['name'];
250  
-						$this->col_info[$i]->type =  $meta['native_type'];
  260
+						$this->col_info[$i]->type =  !empty($meta['native_type']) ? $meta['native_type'] : 'undefined';
251 261
 						$this->col_info[$i]->max_length =  '';
252 262
 					}
253 263
 					else
@@ -295,5 +305,3 @@ function query($query)
295 305
 		}
296 306
 
297 307
 	}
298  
-
299  
-?>
1  sqlite/ez_sql_sqlite.php
@@ -204,4 +204,3 @@ function query($query)
204 204
 
205 205
 	}
206 206
 
207  
-?>
3  sqlsrv/ez_sql_sqlsrv.php
@@ -373,6 +373,3 @@ function disconnect()
373 373
 
374 374
 
375 375
 	} // end class
376  
-
377  
-
378  
-?>
3  sybase/ez_sql_sybase.php
@@ -384,6 +384,3 @@ function ConvertMySqlTosybase($query)
384 384
 
385 385
 
386 386
 	}
387  
-
388  
-
389  
-?>

0 notes on commit b3da060

Please sign in to comment.
Something went wrong with that request. Please try again.