note 106695 added to function.pg-field-size
| From: | gjc at aus3d dot com | Date: | Tue, 29 Nov 2011 03:30:52 +0000 |
| Subject: | note 106695 added to function.pg-field-size | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-184750@lists.php.net to get a copy of this message | ||
RE: Postgress
//returns array of column names and types for table name
function GetColNamesTypes($table)
{
//echo "GetCols('{$table}')<br>";
$a = Array();
if ($table)
{
//$q = "SHOW COLUMNS FROM {$table}";
$q = "SELECT column_name,data_type FROM information_schema.columns WHERE table_name
='{$table}' ORDER BY ordinal_position";
//echo "q='{$q}'<br>";
$rs = $this->Exec($q);
if ($rs)
{
$num = pg_num_rows($rs);
$i = 0;
while ($row = pg_fetch_row($rs))
{
$a[$i][0] = $row[0];
$a[$i][1] = $row[1];
$i++;
}
pg_free_result($rs);
}
else
{
echo $this->utl->Err("Failed at GetCols($table)!");
}
}
return $a;
}
----
Server IP: 117.55.229.1
Probable Submitter: 123.243.17.213
----
Manual Page -- http://www.php.net/manual/en/function.pg-field-size.php
Edit -- https://master.php.net/note/edit/106695
Del: integrated -- https://master.php.net/note/delete/106695/integrated
Del: useless -- https://master.php.net/note/delete/106695/useless
Del: bad code -- https://master.php.net/note/delete/106695/bad+code
Del: spam -- https://master.php.net/note/delete/106695/spam
Del: non-english -- https://master.php.net/note/delete/106695/non-english
Del: in docs -- https://master.php.net/note/delete/106695/in+docs
Del: other reasons-- https://master.php.net/note/delete/106695
Reject -- https://master.php.net/note/reject/106695
Search -- https://master.php.net/manage/user-notes.php