getColumnNames

Return the name of the tables.

Parameters

getColumnNames($tablename)
$tablename:Name of the table to get the column names.

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

require_once 'dalmp.php';

$user = getenv('MYSQL_USER') ?: 'root';
$password = getenv('MYSQL_PASS') ?: '';

$DSN = "utf8://$user:$password".'@127.0.0.1/test';

$db = new DALMP\Database($DSN);

$rs = $db->getColumnNames();

// output of print_r($rs);
Array
(
    [0] => Code
    [1] => Name
    [2] => Continent
    [3] => Region
    [4] => SurfaceArea
    [5] => IndepYear
    [6] => Population
    [7] => LifeExpectancy
    [8] => GNP
    [9] => GNPOld
    [10] => LocalName
    [11] => GovernmentForm
    [12] => HeadOfState
    [13] => Capital
    [14] => Code2
)

Thanks Navicat for supporting Open Source projects.

Navicat



A great amount of time has been spent creating, crafting and maintaining this software, please consider donating.

Donating helps ensure continued support, development and availability.

dalmp


comments powered by Disqus