テーブルに 6 列の MySQL データベースがあります。最終的には約 100 行になりますが、今のところ 3 行あります。
列のタイトル: FirstName、SecondName、Sentence1、Sentence2、Sentence3、Sentence4
すべてのテーブルは VARCHAR に設定されています
Web ページで php を使用して、各行からランダム データを呼び出したいと考えています。
PHPを使用してランダム化する方が速いと読みましたが、検索してもこれを行う方法が本当にわかりません。
MySQL データベースに接続し、次のコードを使用して返される結果を取得できます。
    <?php
    // Connect to database server
    mysql_connect("localhost", "xxx", "yyy") or die (mysql_error ());
    // Select database
    mysql_select_db("zzz") or die(mysql_error());
    // SQL query
    $strSQL = "SELECT * FROM Users";
    // Execute the query (the recordset $rs contains the result)
    $rs = mysql_query($strSQL);
    // Loop the recordset $rs
    // Each row will be made into an array ($row) using mysql_fetch_array
    while($row = mysql_fetch_array($rs)) {
    // Write the value of the column FirstName (which is now in the array $row)
    echo $row['FirstName'] . "<br />";
      }
    // Close the database connection
    mysql_close();
    ?>
しかし、これは 1 列のデータを返すだけです。次のようなものを使用して、Webページでランダムコードを返す必要があります。
echo $firstname . $lastname . $sentence1 . $sentence2 . $sentence3 . $sentence4;
これは、後でさらに 3 ~ 4 行繰り返されることに注意してください。
echo $firstname_2 . $lastname_2 . $sentence1_2 . $sentence2_2 . $sentence3_2 . $sentence4_2;
私は配列にあまり熱心ではありませんが、誰かが私を始めてくれるなら、それは素晴らしいことです、ありがとう.