久久久久久久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. 主站蜘蛛池模板: 欧美性高潮| 麻豆av一区二区三区久久 | www.亚洲成人网| 中文字字幕在线中文乱码范文 | 国产乱精品一区二区三区 | 日本特黄a级高清免费大片 成年人黄色小视频 | 欧美日韩大陆 | 罗宾被扒开腿做同人网站 | 久久综合久色欧美综合狠狠 | 成人免费在线视频 | 色婷婷综合久久久久中文一区二区 | 在线视频91 | 国产一区不卡 | 妖精视频一区二区三区 | 欧美精品第三页 | av大片 | 国产一区二区三区视频免费观看 | 日韩字幕一区 | 精品亚洲一区二区 | 欧美精品黄 | 国产一区久久久 | 国产激情视频在线观看 | 国产精品一区在线 | 九九福利 | 青青久视频 | 特级毛片www | 黄网站免费在线看 | 亚洲精品一二三区 | 亚洲精品久久久 | 91素人| zzzwww在线看片免费 | 中文字幕一区二区三区精彩视频 | 久久综合色综合 | 午夜影晥 | 午夜电影日韩 | 中文字幕成人免费视频 | 亚洲一区久久 | 一区二区精品电影 | 91精品国产综合久久久动漫日韩 | 亚洲一区视频 | 亚洲人成免费 |