system/database/drivers/cubrid/cubrid_driver.php 1 location
|
@@ 332-356 (lines=25) @@
|
329 |
|
* @param string $table |
330 |
|
* @return array |
331 |
|
*/ |
332 |
|
public function field_data($table) |
333 |
|
{ |
334 |
|
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) |
335 |
|
{ |
336 |
|
return FALSE; |
337 |
|
} |
338 |
|
$query = $query->result_object(); |
339 |
|
|
340 |
|
$retval = array(); |
341 |
|
for ($i = 0, $c = count($query); $i < $c; $i++) |
342 |
|
{ |
343 |
|
$retval[$i] = new stdClass(); |
344 |
|
$retval[$i]->name = $query[$i]->Field; |
345 |
|
|
346 |
|
sscanf($query[$i]->Type, '%[a-z](%d)', |
347 |
|
$retval[$i]->type, |
348 |
|
$retval[$i]->max_length |
349 |
|
); |
350 |
|
|
351 |
|
$retval[$i]->default = $query[$i]->Default; |
352 |
|
$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
353 |
|
} |
354 |
|
|
355 |
|
return $retval; |
356 |
|
} |
357 |
|
|
358 |
|
// -------------------------------------------------------------------- |
359 |
|
|
system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php 1 location
|
@@ 145-169 (lines=25) @@
|
142 |
|
* @param string $table |
143 |
|
* @return array |
144 |
|
*/ |
145 |
|
public function field_data($table) |
146 |
|
{ |
147 |
|
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) |
148 |
|
{ |
149 |
|
return FALSE; |
150 |
|
} |
151 |
|
$query = $query->result_object(); |
152 |
|
|
153 |
|
$retval = array(); |
154 |
|
for ($i = 0, $c = count($query); $i < $c; $i++) |
155 |
|
{ |
156 |
|
$retval[$i] = new stdClass(); |
157 |
|
$retval[$i]->name = $query[$i]->Field; |
158 |
|
|
159 |
|
sscanf($query[$i]->Type, '%[a-z](%d)', |
160 |
|
$retval[$i]->type, |
161 |
|
$retval[$i]->max_length |
162 |
|
); |
163 |
|
|
164 |
|
$retval[$i]->default = $query[$i]->Default; |
165 |
|
$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
166 |
|
} |
167 |
|
|
168 |
|
return $retval; |
169 |
|
} |
170 |
|
|
171 |
|
// -------------------------------------------------------------------- |
172 |
|
|
system/database/drivers/mysql/mysql_driver.php 1 location
|
@@ 418-442 (lines=25) @@
|
415 |
|
* @param string $table |
416 |
|
* @return array |
417 |
|
*/ |
418 |
|
public function field_data($table) |
419 |
|
{ |
420 |
|
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) |
421 |
|
{ |
422 |
|
return FALSE; |
423 |
|
} |
424 |
|
$query = $query->result_object(); |
425 |
|
|
426 |
|
$retval = array(); |
427 |
|
for ($i = 0, $c = count($query); $i < $c; $i++) |
428 |
|
{ |
429 |
|
$retval[$i] = new stdClass(); |
430 |
|
$retval[$i]->name = $query[$i]->Field; |
431 |
|
|
432 |
|
sscanf($query[$i]->Type, '%[a-z](%d)', |
433 |
|
$retval[$i]->type, |
434 |
|
$retval[$i]->max_length |
435 |
|
); |
436 |
|
|
437 |
|
$retval[$i]->default = $query[$i]->Default; |
438 |
|
$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
439 |
|
} |
440 |
|
|
441 |
|
return $retval; |
442 |
|
} |
443 |
|
|
444 |
|
// -------------------------------------------------------------------- |
445 |
|
|
system/database/drivers/mysqli/mysqli_driver.php 1 location
|
@@ 463-487 (lines=25) @@
|
460 |
|
* @param string $table |
461 |
|
* @return array |
462 |
|
*/ |
463 |
|
public function field_data($table) |
464 |
|
{ |
465 |
|
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) |
466 |
|
{ |
467 |
|
return FALSE; |
468 |
|
} |
469 |
|
$query = $query->result_object(); |
470 |
|
|
471 |
|
$retval = array(); |
472 |
|
for ($i = 0, $c = count($query); $i < $c; $i++) |
473 |
|
{ |
474 |
|
$retval[$i] = new stdClass(); |
475 |
|
$retval[$i]->name = $query[$i]->Field; |
476 |
|
|
477 |
|
sscanf($query[$i]->Type, '%[a-z](%d)', |
478 |
|
$retval[$i]->type, |
479 |
|
$retval[$i]->max_length |
480 |
|
); |
481 |
|
|
482 |
|
$retval[$i]->default = $query[$i]->Default; |
483 |
|
$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
484 |
|
} |
485 |
|
|
486 |
|
return $retval; |
487 |
|
} |
488 |
|
|
489 |
|
// -------------------------------------------------------------------- |
490 |
|
|
system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php 1 location
|
@@ 272-296 (lines=25) @@
|
269 |
|
* @param string $table |
270 |
|
* @return array |
271 |
|
*/ |
272 |
|
public function field_data($table) |
273 |
|
{ |
274 |
|
if (($query = $this->query('SHOW COLUMNS FROM '.$this->protect_identifiers($table, TRUE, NULL, FALSE))) === FALSE) |
275 |
|
{ |
276 |
|
return FALSE; |
277 |
|
} |
278 |
|
$query = $query->result_object(); |
279 |
|
|
280 |
|
$retval = array(); |
281 |
|
for ($i = 0, $c = count($query); $i < $c; $i++) |
282 |
|
{ |
283 |
|
$retval[$i] = new stdClass(); |
284 |
|
$retval[$i]->name = $query[$i]->Field; |
285 |
|
|
286 |
|
sscanf($query[$i]->Type, '%[a-z](%d)', |
287 |
|
$retval[$i]->type, |
288 |
|
$retval[$i]->max_length |
289 |
|
); |
290 |
|
|
291 |
|
$retval[$i]->default = $query[$i]->Default; |
292 |
|
$retval[$i]->primary_key = (int) ($query[$i]->Key === 'PRI'); |
293 |
|
} |
294 |
|
|
295 |
|
return $retval; |
296 |
|
} |
297 |
|
|
298 |
|
// -------------------------------------------------------------------- |
299 |
|
|