Home    Back    Forward    Refresh    txtSQL Homepage

execute
Purpose: To execute a txtSQL command and get results
txtSQL >= 2.0.0 Beta
mixed execute ( $action [, $args] )

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 Comments - execute
No comments posted yet;
Last Page Next Page

'Language Reference'

User Functions

Database Functions

Data Manipulation Functions
  • select
  • insert
  • update
  • delete
  • execute

    Table Functions

    Error Handling Functions

    SQL Syntax

  • [ txtSQL Documentation powered by txtSQL | 6 SQL Queries ]