GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • codeigniter4/CodeIgniter4
  • Home
  • Welcome to CodeIgniter4
  • Server Requirements
  • Credits
  • PSR Compliance
  • License Agreement
  • Installation
  • Composer Installation
  • Manual Installation
  • Running Your App
  • Worker Mode
  • Troubleshooting
  • Deployment

This view

  • Original page
  • New address

GeezerVison is showing codeigniter4.github.io — Custom Function Calls - CodeIgniter

Edit this page

Custom Function Calls¶

$db->callFunction()¶

This function enables you to call PHP database functions that are not natively included in CodeIgniter, in a platform-independent manner. For example, let's say you want to call the mysqli_get_client_info() function, which is not natively supported by CodeIgniter. You could do so like this:

<?php

$db->callFunction('get_client_info');

You must supply the name of the function, without the mysqli_ prefix, in the first parameter. The prefix is added automatically based on which database driver is currently being used. This permits you to run the same function on different database platforms. Obviously, not all function calls are identical between platforms, so there are limits to how useful this function can be in terms of portability.

Any parameters needed by the function you are calling are passed starting from the second parameter.

<?php

$db->callFunction('some_function', $param1, $param2 /* , ... */);

Often, you will either need to supply a database connection ID or a database result ID. The connection ID can be accessed using:

<?php

$db->connID;

The result ID can be accessed from within your result object, like this:

<?php

$query = $db->query('SOME QUERY');

$query->resultID;
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.