-2
<?php
mysql_connect('localhost','root','root');
mysql_select_db('moodle');
            $ht = "";
            $sql = "select * from absence where username='iset' ";
            $sql_query = mysql_query($sql);

            while( $row = mysql_fetch_object($sql_query) ){
                $ht +=  "<li>".$row->classe."</li>";

            }
echo $ht;
?>   

常に // 0 'absence' に username = 'iset' の 3 行あります $ht に問題があると思いますが !!! ありがとう

4

1 に答える 1

6

PHP での文字列連結.は、 ではなくを使用して行われ+ます。

この行

            $ht +=  "<li>".$row->classe."</li>";

なるはず

            $ht .=  "<li>".$row->classe."</li>";
于 2012-04-25T07:46:43.083 に答える