DatabaseQuery::copyBindValuesTo() method

Copy bind values from this query to another given DatabaseQuery or \PDOStatement

This is a more readable interface to the getBindValues() method and does the same thing as passing a DatabaseQuery or PDOStatement to the getBindValues() method.

Available since version 3.0.157.

Usage

// basic usage
$int = $databaseQuery->copyBindValuesTo($query);

// usage with all arguments
$int = $databaseQuery->copyBindValuesTo($query, array $options = []);

Arguments

NameType(s)Description
queryDatabaseQuery, \PDOStatement
options (optional)array

Additional options

  • inSQL (string): Only copy bind values that are referenced in given SQL string

Return value

int

Number of bind values that were copied


DatabaseQuery methods and properties

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #563
    In the 563rd issue of ProcessWire Weekly we will share the latest weekly update from Ryan, as well as the latest news and updates from the ProcessWire community. Read on!
    Weekly.pw / 22 February 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • Subscribe to weekly ProcessWire news

“Indeed, if ProcessWire can be considered as a CMS in its own right, it also offers all the advantages of a CMF (Content Management Framework). Unlike other solutions, the programmer is not forced to follow the proposed model and can integrate his/her ways of doing things.” —Guy Verville, Spiria Digital Inc.