note 90533 added to function.odbc-field-name
| From: | anuga at anuga dot se | Date: | Mon, 27 Apr 2009 07:46:41 +0000 |
| Subject: | note 90533 added to function.odbc-field-name | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-153802@lists.php.net to get a copy of this message | ||
I've been toying around with this for awhile to make it as simple and fast as possible.
<?php
/* Start The Connection */
if(!$odbc['connection'] = odbc_connect('DNS','USER','PASS'))
{
exit("Connection Failed<br />\n");
}
else
{
echo("Connected<br />\n");
}
/* Select Which Table */
$odbc['table'] = "table";
/* Fetch The Fieldnames into an Array */
if($result = odbc_exec($odbc['connection'],"select * from
$odbc['table'];"))
{
for($i = 1;$i <= odbc_num_fields($result);$i++)
{
$odbc['rows']['fields'][$i] = odbc_field_name($result,$i);
}
unset($i);
odbc_free_result($result);
}
else
{
exit("Error in SQL Query");
}
/* Close The Connection */
if(odbc_close($odbc['connection']))
{
odbc_close($odbc['connection']);
}
/* Print The Array */
if(!empty($odbc['rows']))
{
print_r($odbc['rows']);
}
?>
----
Server IP: 80.67.2.2
Probable Submitter: 89.253.82.225
----
Manual Page -- http://www.php.net/manual/en/function.odbc-field-name.php
Edit -- https://master.php.net/note/edit/90533
Del: integrated -- https://master.php.net/note/delete/90533/integrated
Del: useless -- https://master.php.net/note/delete/90533/useless
Del: bad code -- https://master.php.net/note/delete/90533/bad+code
Del: spam -- https://master.php.net/note/delete/90533/spam
Del: non-english -- https://master.php.net/note/delete/90533/non-english
Del: in docs -- https://master.php.net/note/delete/90533/in+docs
Del: other reasons-- https://master.php.net/note/delete/90533
Reject -- https://master.php.net/note/reject/90533
Search -- https://master.php.net/manage/user-notes.php