Asf_Db_AbstractAdapter::exeQuery

执行一条SQL语句, 返回影响的行数


Description

public int exequery(string $sql [, array $bind_value = array()])

Parameters

sql

SQL 语句

bind_value

把一个值绑定到一个参数

Return Values

返回影响的行数 大于零代表成功, false/0/NULL 代表失败

Examples

Connect MySQL Database

<?php
$configs = array(
    'dsn' => array('host' => '127.0.0.1', 'dbname' => 'test', 'port' => 6666),
    'username' => 'test',
    'password' => 'AbcdefRDvgedf',
);

$mysql = new Asf_Db_Adapter_Mysql($configs);
$mysql->setTableName('test1');

Example #1

<?php
$sql_exenoquery = "update user set nickname = ? where id = ?";
var_dump($mysql->exeQuery($sql_exenoquery, array('test1', 95)));