Mysql fetch array, table results

后端 未结 6 1807
名媛妹妹
名媛妹妹 2021-01-14 10:07

i\'m pretty new to this and not sure how should i do it,

I\'ve got a database with a column called \"names\"

how can i make it display in so?



        
6条回答
  •  孤街浪徒
    2021-01-14 10:33

    $row will update on each iteration of the loop:

    $result = mysql_query('SELECT * FROM member');
    
    echo '';
    
    for($i = 0; $row = mysql_fetch_array($result); $i = ($i+1)%3){
        echo ''.$row['names'].'';
        if($i == 2)
            echo '';
    }
    
    echo '';
    

提交回复
热议问题