Taro Yamashita
taro****@panth*****
2009年 6月 28日 (日) 23:21:03 JST
こんにちは。
Taroと申します。
1.7.0をお使いとの事ですが、我が家の1.7.1ではDB_utility.phpの
該当箇所は
method_exists($query, 'list_fields')
となっておりました。
本家のサイトを確認してみると、1.7.1でのBug Fixに
Fixed a bug where csv_from_result() was checking for a nonexistent method.
とありましたので、1.7.0のバグのようですので、1.7.1にアップデート
されるのが良いのではないでしょうか??
Taro
kaz さんは書きました:
> こんばんは、kazです。
> データベースの内容を保存しようと思ってcsv_from_resultをつかいましたが"You must submit a valid result object"のエラーが出ます。
> コードはCodeIgniter1.7.0のサンプルそのままです。
> <?php
> class Backup extends Controller {
> function Backup()
> {
> parent::Controller();
> }
> function index()
> {
>
> $this->load->dbutil();
> $query = $this->db->query("SELECT * FROM mytable");
> echo $this->dbutil->csv_from_result($query);
> }
> }
> ?>
>
> DB_utility.phpのcsv_from_resultをみたら
> if ( ! is_object($query) OR ! method_exists($query, 'field_names'))の! method_exists($query, 'field_names')の部分でエラーとなっています。
> これはどういう意図でこのようになってるのかわかりません。
> 又、! method_exists($query, 'field_names')の部分を削除してしまってよいのでしょうか?
> ご教授お願いします。
>
> _______________________________________________
> Codeigniter-users mailing list
> Codei****@lists*****
> http://lists.sourceforge.jp/mailman/listinfo/codeigniter-users
>