PHP | odbc_columns() Function

PHP odbc_columns() Function


Hello folks! welcome back to a new edition of our tutorial on PHP. In this tutorial guide, we are going to be studying about the PHP odbc_columns() Function.

The PHP odbc_columns() function lists the column names in the specified table.

Syntax

Following below is the syntax to use this function -

resource odbc_columns ( resource $connection_id [, string $qualifier 
   [, string $schema [, string $table_name [, string $column_name ]]]] )


Parameter Details

Sr.NoDescription
1

connection_id

it contains connection id information

2

qualifier

It contained information about qualifier

3

schema

It contained information about owner

4

table_name

It contained information about table name

5

column_name

It contained information about column_name arguments


Return Value

This built-in function returns an odbc result identifier on success, else false on failure.

Example

Try out the following example below -

<?php
   include('header.php'); 
   
   $outval = odbc_columns($connection, "Db_name", "%", "table_name", "%");
   $pages = array();
   
   while (odbc_fetch_into($outval, $pages)) {
      echo $pages[3] . "<br />\n";
   }
?>


Alright guys! This is where we are going to be rounding up for this tutorial post. In our next tutorial, we are going to be discussing about the PHP odbc_commit() Function.

Do feel free to ask your questions where necessary and we will attend to them as soon as possible. If this tutorial was helpful to you, you can use the share button to share this tutorial.

Do follow us on our various social media handles available and also subscribe to our newsletter to get our tutorial posts delivered directly to your emails.

Thanks for reading and bye for now.