Subversion-Projekte lars-tiefland.ci

Revision

Revision 2258 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 2258 Revision 2414
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2018, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2019, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2018, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2019, British Columbia Institute of Technology (https://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	https://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.0.0
35
 * @since	Version 1.0.0
36
 * @filesource
36
 * @filesource
37
 */
37
 */
38
defined('BASEPATH') OR exit('No direct script access allowed');
38
defined('BASEPATH') OR exit('No direct script access allowed');
Zeile 140... Zeile 140...
140
	/**
140
	/**
141
	 * Database port
141
	 * Database port
142
	 *
142
	 *
143
	 * @var	int
143
	 * @var	int
144
	 */
144
	 */
145
	public $port			= '';
145
	public $port			= NULL;
Zeile 146... Zeile 146...
146
 
146
 
147
	/**
147
	/**
148
	 * Persistent connection flag
148
	 * Persistent connection flag
149
	 *
149
	 *
Zeile 1306... Zeile 1306...
1306
	 * @param	string	$table	Table name
1306
	 * @param	string	$table	Table name
1307
	 * @return	array
1307
	 * @return	array
1308
	 */
1308
	 */
1309
	public function list_fields($table)
1309
	public function list_fields($table)
1310
	{
1310
	{
1311
		// Is there a cached result?
-
 
1312
		if (isset($this->data_cache['field_names'][$table]))
-
 
1313
		{
-
 
1314
			return $this->data_cache['field_names'][$table];
-
 
1315
		}
-
 
1316
 
-
 
1317
		if (FALSE === ($sql = $this->_list_columns($table)))
1311
		if (FALSE === ($sql = $this->_list_columns($table)))
1318
		{
1312
		{
1319
			return ($this->db_debug) ? $this->display_error('db_unsupported_function') : FALSE;
1313
			return ($this->db_debug) ? $this->display_error('db_unsupported_function') : FALSE;
1320
		}
1314
		}
Zeile 1321... Zeile 1315...
1321
 
1315
 
1322
		$query = $this->query($sql);
1316
		$query = $this->query($sql);
Zeile 1323... Zeile 1317...
1323
		$this->data_cache['field_names'][$table] = array();
1317
		$fields = array();
1324
 
1318
 
1325
		foreach ($query->result_array() as $row)
1319
		foreach ($query->result_array() as $row)
1326
		{
1320
		{
Zeile 1340... Zeile 1334...
1340
					// We have no other choice but to just get the first element's key.
1334
					// We have no other choice but to just get the first element's key.
1341
					$key = key($row);
1335
					$key = key($row);
1342
				}
1336
				}
1343
			}
1337
			}
Zeile 1344... Zeile 1338...
1344
 
1338
 
1345
			$this->data_cache['field_names'][$table][] = $row[$key];
1339
			$fields[] = $row[$key];
Zeile 1346... Zeile 1340...
1346
		}
1340
		}
1347
 
1341
 
Zeile 1348... Zeile 1342...
1348
		return $this->data_cache['field_names'][$table];
1342
		return $fields;
Zeile 1349... Zeile 1343...
1349
	}
1343
	}