1

この結果を読み取るものを作りたいと思っています。しかし、cmd、結果が正しく出ません。

codeigniter + CLI を使用する場合

<?php
class Tools extends CI_Controller {
    public function message($to="World")
    {
        echo " Hello {$to}! ".PHP_EOL; 
        echo "test1".PHP_EOL;

        $this->load->database();
        echo "test2".PHP_EOL;

        $query = $this->db->query("SELECT * FROM test3");
        echo "test3".PHP_EOL;
        foreach ($query->result() as $row)
        {
            echo $row->pid.PHP_EOL;
            echo $row->mane.PHP_EOL;
            echo $row->title.PHP_EOL;
        }
    }
}
?>

私は欲しいとcmdで

c:\>php index.php tools message world
Hello world!
test1
c:\>

なぜ私は答えを得ることができないのですか? 私が欲しい

c:\>php index.php tools message world
Hello world!
test1
test2
test3
...
....(about database query)
c:\>
4

0 に答える 0