0

我有一个array(1) { [0]=> array(1) { ["id"]=> string(1) "2" } }

我只得到一个值,怎么能把它分解成一个字符串?

模型:

$table = $this->_table_products_manufacturers;
        $query  = $this->db->query("SELECT $table.id FROM $table WHERE $table.id = $manufacturer_id");

        return $query->result_array();
4

1 回答 1

1

就像是:

$table = $this->_table_products_manufacturers;
$query = $this->db->query("SELECT $table.id FROM $table WHERE $table.id = $manufacturer_id");
$result = $query->result_array();
return $result[0]['id'];

会有帮助吗?

于 2013-09-22T04:31:47.520 回答