execute Back | Forward | Home

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions
  • select

  • insert

  • update

  • delete

  • execute


  • Table Functions

    Error Handling Functions

    << Last Section ( delete ) execute Next Section ( Table Functions ) >>
    Usage mixed execute ( $action [, $args] )
    Purpose To execute a txtSQL command and get results
    Availability txtSQL >= 2.0.0 Beta

    This function will execute a valid txtSQL command and return that function's results. The list of valid $action's are 'select', 'insert', 'update', 'delete', 'show databases', 'create database', 'drop database', 'rename database', 'show tables', 'create table', 'drop table', 'alter table', and 'describe'.

    The $args is the same arguments as if you were using the function seperately. Click a function for more information on what is to be defined in the $args

    Note- For more information on defining a where clause, see the how to create a where clause section, or for defining a limit clause, see how to create a limit clause section
    Note- If no $db is specified and no database is already selected, txtSQL will issue an error

    Example 19: execute() with 'select' as action Copy to Clipboard
    <?php
    $data
    =
    $sql->execute('select',
            array(
    'table' => 'testTable',
                  
    'db'    => 'testDb',
                  
    'where' => array('strtolower(name) = john doe')));

    print_r($data);
    ?>

    User-Contributed Comments for:
    execute()
    No comments found;