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