Passed
Push — master ( aca751...dd3234 )
by Joe
04:55 queued 02:03
created

Db::transactionAbort()   A

Complexity

Conditions 3
Paths 2

Size

Total Lines 4
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 3.1406

Importance

Changes 0
Metric Value
cc 3
eloc 3
nc 2
nop 0
dl 0
loc 4
ccs 3
cts 4
cp 0.75
crap 3.1406
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * MySQL Related Functionality
4
 * @author Joe Huss <[email protected]>
5
 * @copyright 2018
6
 * @package MyAdmin
7
 * @category SQL
8
 */
9
10
namespace MyDb\Mysqli;
11
12
use \MyDb\Generic;
13
use \MyDb\Db_Interface;
14
15
/**
16
 * Db
17
 *
18
 * @access public
19
 */
20
class Db extends Generic implements Db_Interface {
21
	/**
22
	 * @var string
23
	 */
24
	public $type = 'mysqli';
25
26
	/**
27
	 * alias function of select_db, changes the database we are working with.
28
	 *
29
	 * @param string $database the name of the database to use
30
	 * @return void
31
	 */
32 1
	public function useDb($database) {
33 1
		$this->selectDb($database);
34
	}
35
36
	/**
37
	 * changes the database we are working with.
38
	 *
39
	 * @param string $database the name of the database to use
40
	 * @return void
41
	 */
42 1
	public function selectDb($database) {
43 1
		$this->connect();
44 1
		mysqli_select_db($this->linkId, $database);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_select_db() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

44
		mysqli_select_db(/** @scrutinizer ignore-type */ $this->linkId, $database);
Loading history...
45
	}
46
47
	/* public: connection management */
48
49
	/**
50
	 * Db::connect()
51
	 * @param string $database
52
	 * @param string $host
53
	 * @param string $user
54
	 * @param string $password
55
	 * @return int|\mysqli
56
	 */
57 25
	public function connect($database = '', $host = '', $user = '', $password = '') {
58
		/* Handle defaults */
59 25
		if ($database == '')
60 25
			$database = $this->database;
61 25
		if ($host == '')
62 25
			$host = $this->host;
63 25
		if ($user == '')
64 25
			$user = $this->user;
65 25
		if ($password == '')
66 25
			$password = $this->password;
67
		/* establish connection, select database */
68 25
		if (!is_object($this->linkId)) {
69 25
			$this->connectionAttempt++;
70 25
			if ($this->connectionAttempt > 1)
71 6
				error_log("MySQLi Connection Attempt #{$this->connectionAttempt}/{$this->maxConnectErrors}");
72 25
			if ($this->connectionAttempt >= $this->maxConnectErrors) {
73
				$this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error);
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $mysqli seems to be never defined.
Loading history...
74
				return 0;
75
			}
76 25
			$this->linkId = mysqli_init();
77 25
			$this->linkId->options(MYSQLI_INIT_COMMAND, "SET NAMES {$this->characterSet} COLLATE {$this->collation}, COLLATION_CONNECTION = {$this->collation}, COLLATION_DATABASE = {$this->collation}");
78 25
			$this->linkId->real_connect($host, $user, $password, $database);
79 25
			$this->linkId->set_charset($this->characterSet);
80 25
			if ($this->linkId->connect_errno) {
81
				$this->halt("connect($host, $user, \$password) failed. ".$mysqli->connect_error);
82
				return 0;
83
			}
84
		}
85 25
		return $this->linkId;
86
	}
87
88
	/**
89
	 * Db::disconnect()
90
	 * @return bool
91
	 */
92 1
	public function disconnect() {
93 1
		$return = method_exists($this->linkId, 'close') ? $this->linkId->close() : false;
94 1
		$this->linkId = 0;
95 1
		return $return;
96
	}
97
98
	/**
99
	 * @param $string
100
	 * @return string
101
	 */
102 2
	public function real_escape($string = '') {
103 2
		if ((!is_resource($this->linkId) || $this->linkId == 0) && !$this->connect())
0 ignored issues
show
introduced by
The condition is_resource($this->linkId) is always false.
Loading history...
104
			return $this->escape($string);
105 2
		return mysqli_real_escape_string($this->linkId, $string);
106
	}
107
108
	/**
109
	 * discard the query result
110
	 * @return void
111
	 */
112 1
	public function free() {
113 1
		if (is_resource($this->queryId))
0 ignored issues
show
introduced by
The condition is_resource($this->queryId) is always false.
Loading history...
114
			@mysqli_free_result($this->queryId);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition for mysqli_free_result(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

114
			/** @scrutinizer ignore-unhandled */ @mysqli_free_result($this->queryId);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
115 1
		$this->queryId = 0;
116
	}
117
118
	/**
119
	 * Db::queryReturn()
120
	 *
121
	 * Sends an SQL query to the server like the normal query() command but iterates through
122
	 * any rows and returns the row or rows immediately or FALSE on error
123
	 *
124
	 * @param mixed $query SQL Query to be used
125
	 * @param string $line optionally pass __LINE__ calling the query for logging
126
	 * @param string $file optionally pass __FILE__ calling the query for logging
127
	 * @return mixed FALSE if no rows, if a single row it returns that, if multiple it returns an array of rows, associative responses only
128
	 */
129 1
	public function queryReturn($query, $line = '', $file = '') {
130 1
		$this->query($query, $line, $file);
131 1
		if ($this->num_rows() == 0) {
132 1
			return false;
133 1
		} elseif ($this->num_rows() == 1) {
134 1
			$this->next_record(MYSQLI_ASSOC);
135 1
			return $this->Record;
136
		} else {
137 1
			$out = [];
138 1
			while ($this->next_record(MYSQLI_ASSOC))
139 1
				$out[] = $this->Record;
140 1
			return $out;
141
		}
142
	}
143
144
	/**
145
	 * db:qr()
146
	 *
147
	 *  alias of queryReturn()
148
	 *
149
	 * @param mixed $query SQL Query to be used
150
	 * @param string $line optionally pass __LINE__ calling the query for logging
151
	 * @param string $file optionally pass __FILE__ calling the query for logging
152
	 * @return mixed FALSE if no rows, if a single row it returns that, if multiple it returns an array of rows, associative responses only
153
	 */
154 1
	public function qr($query, $line = '', $file = '') {
155 1
		return $this->queryReturn($query, $line, $file);
156
	}
157
158
	/**
159
	 * creates a prepaired statement from query
160
	 *
161
	 * @param string $query sql wuery like INSERT INTO table (col) VALUES (?)  or  SELECT * from table WHERE col1 = ? and col2 = ?  or  UPDATE table SET col1 = ?, col2 = ? WHERE col3 = ?
162
	 * @return int|\MyDb\Mysqli\mysqli_stmt
0 ignored issues
show
Bug introduced by
The type MyDb\Mysqli\mysqli_stmt was not found. Did you mean mysqli_stmt? If so, make sure to prefix the type with \.
Loading history...
163
	 */
164 1
	public function prepare($query) {
165 1
		if (!$this->connect())
166
			return 0;
167 1
		$haltPrev = $this->haltOnError;
0 ignored issues
show
Unused Code introduced by
The assignment to $haltPrev is dead and can be removed.
Loading history...
168 1
		$this->haltOnError = 'no';
169 1
		return mysqli_prepare($this->linkId, $query);
170
	}
171
172
	/**
173
	 * Db::query()
174
	 *
175
	 *  Sends an SQL query to the database
176
	 *
177
	 * @param mixed $queryString
178
	 * @param string $line
179
	 * @param string $file
180
	 * @return mixed 0 if no query or query id handler, safe to ignore this return
181
	 */
182 10
	public function query($queryString, $line = '', $file = '') {
183
		/* No empty queries, please, since PHP4 chokes on them. */
184
		/* The empty query string is passed on from the constructor,
185
		* when calling the class without a query, e.g. in situations
186
		* like these: '$db = new db_Subclass;'
187
		*/
188 10
		if ($queryString == '')
189 1
			return 0;
190 10
		if (!$this->connect()) {
191
			return 0;
192
			/* we already complained in connect() about that. */
193
		}
194 10
		$haltPrev = $this->haltOnError;
195 10
		$this->haltOnError = 'no';
196
		// New query, discard previous result.
197 10
		if (is_resource($this->queryId))
0 ignored issues
show
introduced by
The condition is_resource($this->queryId) is always false.
Loading history...
198
			$this->free();
199 10
		if ($this->Debug)
200 7
			printf("Debug: query = %s<br>\n", $queryString);
201 10
		if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== false)
202
			$this->log($queryString, $line, $file);
203 10
		$tries = 3;
204 10
		$try = 0;
205 10
		$this->queryId = false;
206 10
		while ((null === $this->queryId || $this->queryId === false) && $try <= $tries) {
207 10
			$try++;
208 10
			if ($try > 1) {
209
				@mysqli_close($this->linkId);
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition for mysqli_close(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

209
				/** @scrutinizer ignore-unhandled */ @mysqli_close($this->linkId);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
210
				$this->connect();
211
			}
212 10
			$this->queryId = @mysqli_query($this->linkId, $queryString, MYSQLI_STORE_RESULT);
213 10
			$this->Row = 0;
214 10
			$this->Errno = @mysqli_errno($this->linkId);
215 10
			$this->Error = @mysqli_error($this->linkId);
216 10
			if ($try == 1 && (null === $this->queryId || $this->queryId === false)) {
217
				$this->emailError($queryString, 'Error #'.$this->Errno.': '.$this->Error, $line, $file);
218
			}
219
		}
220 10
		$this->haltOnError = $haltPrev;
221 10
		if (null === $this->queryId || $this->queryId === false)
222
			$this->halt('', $line, $file);
223
224
		// Will return nada if it fails. That's fine.
225 10
		return $this->queryId;
226
	}
227
228
	/**
229
	 * @return array|null|object
230
	 */
231 1
	public function fetchObject() {
232 1
		$this->Record = @mysqli_fetch_object($this->queryId);
0 ignored issues
show
Bug introduced by
$this->queryId of type integer is incompatible with the type mysqli_result expected by parameter $result of mysqli_fetch_object(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

232
		$this->Record = @mysqli_fetch_object(/** @scrutinizer ignore-type */ $this->queryId);
Loading history...
233 1
		return $this->Record;
234
	}
235
236
	/* public: walk result set */
237
238
	/**
239
	 * Db::next_record()
240
	 *
241
	 * @param mixed $resultType
242
	 * @return bool
243
	 */
244 6
	public function next_record($resultType = MYSQLI_BOTH) {
245 6
		if ($this->queryId === false) {
0 ignored issues
show
introduced by
The condition $this->queryId === false is always false.
Loading history...
246
			$this->halt('next_record called with no query pending.');
247
			return 0;
248
		}
249
250 6
		$this->Record = @mysqli_fetch_array($this->queryId, $resultType);
0 ignored issues
show
Bug introduced by
$this->queryId of type integer is incompatible with the type mysqli_result expected by parameter $result of mysqli_fetch_array(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

250
		$this->Record = @mysqli_fetch_array(/** @scrutinizer ignore-type */ $this->queryId, $resultType);
Loading history...
251 6
		++$this->Row;
252 6
		$this->Errno = mysqli_errno($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_errno() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

252
		$this->Errno = mysqli_errno(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
253 6
		$this->Error = mysqli_error($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_error() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

253
		$this->Error = mysqli_error(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
254
255 6
		$stat = is_array($this->Record);
256 6
		if (!$stat && $this->autoFree && is_resource($this->queryId))
0 ignored issues
show
introduced by
The condition is_resource($this->queryId) is always false.
Loading history...
257
			$this->free();
258 6
		return $stat;
259
	}
260
261
	/**
262
	 * switch to position in result set
263
	 * 
264
	 * @param integer $pos the row numbe starting at 0 to switch to
265
	 * @return bool whetherit was successfu or not.
266
	 */
267 1
	public function seek($pos = 0) {
268 1
		$status = @mysqli_data_seek($this->queryId, $pos);
0 ignored issues
show
Bug introduced by
$this->queryId of type integer is incompatible with the type mysqli_result expected by parameter $result of mysqli_data_seek(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

268
		$status = @mysqli_data_seek(/** @scrutinizer ignore-type */ $this->queryId, $pos);
Loading history...
269 1
		if ($status) {
270 1
			$this->Row = $pos;
271
		} else {
272
			$this->halt("seek({$pos}) failed: result has ".$this->num_rows().' rows');
273
			/* half assed attempt to save the day, but do not consider this documented or even desirable behaviour. */
274
			@mysqli_data_seek($this->queryId, $this->num_rows());
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition for mysqli_data_seek(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unhandled  annotation

274
			/** @scrutinizer ignore-unhandled */ @mysqli_data_seek($this->queryId, $this->num_rows());

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
275
			$this->Row = $this->num_rows;
0 ignored issues
show
Bug Best Practice introduced by
The property num_rows does not exist on MyDb\Mysqli\Db. Did you maybe forget to declare it?
Loading history...
276
			return false;
277
		}
278 1
		return true;
279
	}
280
281
	/**
282
	 * Initiates a transaction
283
	 *
284
	 * @return bool
285
	 */
286 25
	public function transactionBegin() {
287 25
		if (version_compare(PHP_VERSION, '5.5.0') < 0)
288
			return true;
289 25
		if (!$this->connect())
290
			return 0;
291 25
		return mysqli_begin_transaction($this->linkId);
292
	}
293
294
	/**
295
	 * Commits a transaction
296
	 *
297
	 * @return bool
298
	 */
299 1
	public function transactionCommit() {
300 1
		if (version_compare(PHP_VERSION, '5.5.0') < 0 || $this->linkId === 0)
301
			return true;
302 1
		return mysqli_commit($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_commit() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

302
		return mysqli_commit(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
303
	}
304
305
	/**
306
	 * Rolls back a transaction
307
	 *
308
	 * @return bool
309
	 */
310 25
	public function transactionAbort() {
311 25
		if (version_compare(PHP_VERSION, '5.5.0') < 0 || $this->linkId === 0)
312
			return true;
313 25
		return mysqli_rollback($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_rollback() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

313
		return mysqli_rollback(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
314
	}
315
316
	/**
317
	 * This will get the last insert ID created on the current connection.  Should only be called after an insert query is
318
	 * run on a table that has an auto incrementing field.  $table and $field are required, but unused here since it's
319
	 * unnecessary for mysql.  For compatibility with pgsql, the params must be supplied.
320
	 *
321
	 * @param string $table
322
	 * @param string $field
323
	 * @return int|string
324
	 */
325 2
	public function getLastInsertId($table, $field) {
326 2
		if (!isset($table) || $table == '' || !isset($field) || $field == '')
327
			return -1;
328
329 2
		return @mysqli_insert_id($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_insert_id() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

329
		return @mysqli_insert_id(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
330
	}
331
332
	/* public: table locking */
333
334
	/**
335
	 * Db::lock()
336
	 * @param mixed  $table
337
	 * @param string $mode
338
	 * @return bool|int|\mysqli_result
339
	 */
340 1
	public function lock($table, $mode = 'write') {
341 1
		$this->connect();
342 1
		$query = 'lock tables ';
343 1
		if (is_array($table)) {
344 1
			foreach ($table as $key => $value) {
345 1
				if ($key == 'read' && $key != 0) {
346
					$query .= "$value read, ";
347
				} else {
348 1
					$query .= "$value $mode, ";
349
				}
350
			}
351 1
			$query = mb_substr($query, 0, -2);
352
		} else {
353 1
			$query .= "$table $mode";
354
		}
355 1
		$res = @mysqli_query($this->linkId, $query);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_query() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

355
		$res = @mysqli_query(/** @scrutinizer ignore-type */ $this->linkId, $query);
Loading history...
356 1
		if (!$res) {
357
			$this->halt("lock($table, $mode) failed.");
358
			return 0;
359
		}
360 1
		return $res;
361
	}
362
363
	/**
364
	 * Db::unlock()
365
	 * @param bool $haltOnError optional, defaults to TRUE, whether or not to halt on error
366
	 * @return bool|int|\mysqli_result
367
	 */
368 1
	public function unlock($haltOnError = true) {
369 1
		$this->connect();
370
371 1
		$res = @mysqli_query($this->linkId, 'unlock tables');
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_query() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

371
		$res = @mysqli_query(/** @scrutinizer ignore-type */ $this->linkId, 'unlock tables');
Loading history...
372 1
		if ($haltOnError === true && !$res) {
373
			$this->halt('unlock() failed.');
374
			return 0;
375
		}
376 1
		return $res;
377
	}
378
379
	/* public: evaluate the result (size, width) */
380
381
	/**
382
	 * Db::affectedRows()
383
	 * @return int
384
	 */
385 2
	public function affectedRows() {
386 2
		return @mysqli_affected_rows($this->linkId);
0 ignored issues
show
Bug introduced by
It seems like $this->linkId can also be of type integer; however, parameter $link of mysqli_affected_rows() does only seem to accept mysqli, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

386
		return @mysqli_affected_rows(/** @scrutinizer ignore-type */ $this->linkId);
Loading history...
387
	}
388
389
	/**
390
	 * Db::num_rows()
391
	 * @return int
392
	 */
393 5
	public function num_rows() {
394 5
		return @mysqli_num_rows($this->queryId);
0 ignored issues
show
Bug introduced by
$this->queryId of type integer is incompatible with the type mysqli_result expected by parameter $result of mysqli_num_rows(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

394
		return @mysqli_num_rows(/** @scrutinizer ignore-type */ $this->queryId);
Loading history...
395
	}
396
397
	/**
398
	 * Db::num_fields()
399
	 * @return int
400
	 */
401 1
	public function num_fields() {
402 1
		return @mysqli_num_fields($this->queryId);
0 ignored issues
show
Bug introduced by
$this->queryId of type integer is incompatible with the type mysqli_result expected by parameter $result of mysqli_num_fields(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

402
		return @mysqli_num_fields(/** @scrutinizer ignore-type */ $this->queryId);
Loading history...
403
	}
404
405
	/**
406
	 * gets an array of the table names in teh current datase
407
	 *
408
	 * @return array
409
	 */
410 1
	public function tableNames() {
411 1
		$return = [];
412 1
		$this->query('SHOW TABLES');
413 1
		$i = 0;
414 1
		while ($info = $this->queryId->fetch_row()) {
0 ignored issues
show
Bug introduced by
The method fetch_row() does not exist on integer. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

414
		while ($info = $this->queryId->/** @scrutinizer ignore-call */ fetch_row()) {

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
415 1
			$return[$i]['table_name'] = $info[0];
416 1
			$return[$i]['tablespace_name'] = $this->database;
417 1
			$return[$i]['database'] = $this->database;
418 1
			++$i;
419
		}
420 1
		return $return;
421
	}
422
}
423
424
/**
425
 * @param $result
426
 * @param $row
427
 * @param int|string $field
428
 * @return bool
429
 */
430
/*
431
function mysqli_result($result, $row, $field = 0) {
432
	if ($result === false) return false;
433
	if ($row >= mysqli_num_rows($result)) return false;
434
	if (is_string($field) && !(mb_strpos($field, '.') === false)) {
435
		$tField = explode('.', $field);
436
		$field = -1;
437
		$tFields = mysqli_fetch_fields($result);
438
		for ($id = 0, $idMax = mysqli_num_fields($result); $id < $idMax; $id++) {
439
			if ($tFields[$id]->table == $tField[0] && $tFields[$id]->name == $tField[1]) {
440
				$field = $id;
441
				break;
442
			}
443
		}
444
		if ($field == -1) return false;
445
	}
446
	mysqli_data_seek($result, $row);
447
	$line = mysqli_fetch_array($result);
448
	return isset($line[$field]) ? $line[$field] : false;
449
}
450
*/