久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='xQQea'></bdo><ul id='xQQea'></ul>

<tfoot id='xQQea'></tfoot><legend id='xQQea'><style id='xQQea'><dir id='xQQea'><q id='xQQea'></q></dir></style></legend>
      <i id='xQQea'><tr id='xQQea'><dt id='xQQea'><q id='xQQea'><span id='xQQea'><b id='xQQea'><form id='xQQea'><ins id='xQQea'></ins><ul id='xQQea'></ul><sub id='xQQea'></sub></form><legend id='xQQea'></legend><bdo id='xQQea'><pre id='xQQea'><center id='xQQea'></center></pre></bdo></b><th id='xQQea'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xQQea'><tfoot id='xQQea'></tfoot><dl id='xQQea'><fieldset id='xQQea'></fieldset></dl></div>
    1. <small id='xQQea'></small><noframes id='xQQea'>

        如何使用數據庫中的值創建 PHP 兩列表?

        How to create PHP two column table with values from the database?(如何使用數據庫中的值創建 PHP 兩列表?)

        1. <tfoot id='MoaiC'></tfoot>

                <tbody id='MoaiC'></tbody>
            • <small id='MoaiC'></small><noframes id='MoaiC'>

              <i id='MoaiC'><tr id='MoaiC'><dt id='MoaiC'><q id='MoaiC'><span id='MoaiC'><b id='MoaiC'><form id='MoaiC'><ins id='MoaiC'></ins><ul id='MoaiC'></ul><sub id='MoaiC'></sub></form><legend id='MoaiC'></legend><bdo id='MoaiC'><pre id='MoaiC'><center id='MoaiC'></center></pre></bdo></b><th id='MoaiC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='MoaiC'><tfoot id='MoaiC'></tfoot><dl id='MoaiC'><fieldset id='MoaiC'></fieldset></dl></div>
                <bdo id='MoaiC'></bdo><ul id='MoaiC'></ul>

                  <legend id='MoaiC'><style id='MoaiC'><dir id='MoaiC'><q id='MoaiC'></q></dir></style></legend>
                • 本文介紹了如何使用數據庫中的值創建 PHP 兩列表?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我想創建一個包含兩列名稱的表,其中名稱取自數據庫,但我不知道如何..我需要幫助.

                  姓名:詹姆斯、約翰、保羅、彼得

                  這是我的代碼:

                  ";$count = 0;$sql = "SELECT * FROM tbl_names";$q = mysql_query($sql);while($res = mysql_fetch_array($q)){$count++;echo "";for($i=1;$i<=2;$i++){echo "<td>{$res['id']}{$res['title']}</td>";}回聲</tr>";}echo "</table>";?>

                  我希望輸出是這樣的:

                  +-------+-------+|詹姆斯 |約翰 |+-------+-------+|保羅 |彼得 |+-------+-------+

                  但我的代碼返回:

                  +-------+-------+|詹姆斯 |詹姆斯 |+-------+-------+|約翰 |約翰 |+-------+-------+|保羅 |保羅 |+-------+-------+|彼得 |彼得 |+-------+-------+

                  我需要你的幫助.

                  解決方案

                  好吧,如果沒有關系并且表格僅用于布局:

                  echo '

                  ';while($res = mysql_fetch_array($q)){echo '

                  '.$res['id'] .$res['title'] .'</div>';}回聲'</div>';

                  在 css 中:

                  .container { 寬度:400px;向左飄浮;}.container .item { 寬度:50%;向左飄浮;高度:一些固定高度;}//或 200 像素

                  無論如何,我更喜歡只使用表格來顯示實際表格并避免將它們用于布局.你可以用 div 做任何你想做的事情(或者在這種情況下你也可以使用 ul 和 li.當然這不是必須的,但通常它需要較少的 HTML,對于 SEO 來說,html 內容比率是需要考慮的.如果你不這樣做"如果你想要固定的高度,你可以像上面的 td/tr 示例一樣包裹每一行.

                  I want to create a table of names with two columns where names are taken from the database but I don't know how.. I need help.

                  Names: James, John, Paul, Peter

                  Here's my code:

                  <?php
                  $con = mysql_connect("localhost","root","");
                  if(!$con){
                  echo "Unable to connect DB";
                  }else{
                      $db = mysql_select_db("persons",$con);
                      echo "Connected";
                  }
                  echo "<table border='1'>";
                  $count = 0;
                  $sql = "SELECT * FROM tbl_names";
                  $q = mysql_query($sql);
                  while($res = mysql_fetch_array($q)){
                  $count++;
                      echo "<tr>";
                          for($i=1;$i<=2;$i++){
                                  echo "<td>{$res['id']}{$res['title']}</td>";
                          }
                      echo "</tr>";   
                  }
                  echo "</table>";
                  ?>
                  

                  I want the output to be like this:

                  +-------+-------+
                  | James | John  |
                  +-------+-------+
                  | Paul  | Peter |
                  +-------+-------+
                  

                  But my code return:

                  +-------+-------+
                  | James | Jame  |
                  +-------+-------+
                  | John  | John  |
                  +-------+-------+
                  | Paul  | Paul  |
                  +-------+-------+
                  | Peter | Peter |
                  +-------+-------+
                  

                  I need your help.

                  解決方案

                  well, if there's no relation and the table is used only for layout:

                  echo '<div class="container">';
                  while($res = mysql_fetch_array($q)){
                      echo '<div class="item">'.  $res['id'] . $res['title'] . '</div>';
                  }
                  echo '</div>';
                  

                  and in css:

                  .container { width: 400px; float: left; }
                  .container .item { width: 50%; float: left; height: someFixedHeight; }
                  // or 200px
                  

                  anyways, it's my preference to use tables only for displaying actual tables and avoid using them for layout. you can do anything you want with div's (or in this case you can also use ul and li. Of course it's not a must but normally it requires less HTML and for SEO the html-content ratio is something to consider. if you don't want fixed heights you can wrap each row as with the td/tr examples above.

                  這篇關于如何使用數據庫中的值創建 PHP 兩列表?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

                    <tfoot id='6UJjm'></tfoot>

                    <small id='6UJjm'></small><noframes id='6UJjm'>

                    <i id='6UJjm'><tr id='6UJjm'><dt id='6UJjm'><q id='6UJjm'><span id='6UJjm'><b id='6UJjm'><form id='6UJjm'><ins id='6UJjm'></ins><ul id='6UJjm'></ul><sub id='6UJjm'></sub></form><legend id='6UJjm'></legend><bdo id='6UJjm'><pre id='6UJjm'><center id='6UJjm'></center></pre></bdo></b><th id='6UJjm'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6UJjm'><tfoot id='6UJjm'></tfoot><dl id='6UJjm'><fieldset id='6UJjm'></fieldset></dl></div>
                      <tbody id='6UJjm'></tbody>
                      <legend id='6UJjm'><style id='6UJjm'><dir id='6UJjm'><q id='6UJjm'></q></dir></style></legend>

                          <bdo id='6UJjm'></bdo><ul id='6UJjm'></ul>
                          1. 主站蜘蛛池模板: 国产sm主人调教女m视频 | 欧美精品a∨在线观看不卡 国产精品久久国产精品 | 草久久 | 日韩国产一区二区三区 | 在线观看国产精品视频 | 精品国产乱码久久久久久蜜退臀 | 成人免费精品视频 | 超碰97av| 久久国产精品99久久久大便 | 久久精品国产亚洲一区二区 | 精品国产欧美一区二区 | 麻豆天堂 | 99久久99| 啪一啪在线视频 | 日韩有码一区 | 粉嫩一区二区三区四区公司1 | 国产一区二区三区欧美 | 国产精品一区二区日韩 | 啪啪综合网 | 欧美性网| 欧美一级黄色片免费观看 | 国产精品久久久久一区二区 | 欧美三级网站 | 精品国产伦一区二区三区观看方式 | 国产清纯白嫩初高生在线播放视频 | 久久最新精品 | 美国一级片在线观看 | 久草欧美 | 精品在线观看一区 | 毛片com| 国产精品久久久久久久久久免费看 | 成人精品一区二区三区 | 国产黄色小视频在线观看 | 精品一区二区三区免费视频 | 成年人视频在线免费观看 | 夜夜爽99久久国产综合精品女不卡 | 亚洲一级视频在线 | 久久欧美高清二区三区 | 91精品国产综合久久久久久丝袜 | 国产成人99久久亚洲综合精品 | 超碰97人人人人人蜜桃 |