<legend id='GskrY'><style id='GskrY'><dir id='GskrY'><q id='GskrY'></q></dir></style></legend>

  • <tfoot id='GskrY'></tfoot>

  • <small id='GskrY'></small><noframes id='GskrY'>

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

      1. 如何从特定 id 的 sql 中正确获取国家和其他信息

        how correctly get country and other info from sql for specific id(如何从特定 id 的 sql 中正确获取国家和其他信息)
          1. <small id='vOwMF'></small><noframes id='vOwMF'>

                <tbody id='vOwMF'></tbody>

              <legend id='vOwMF'><style id='vOwMF'><dir id='vOwMF'><q id='vOwMF'></q></dir></style></legend>
              <tfoot id='vOwMF'></tfoot>

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

                1. <i id='vOwMF'><tr id='vOwMF'><dt id='vOwMF'><q id='vOwMF'><span id='vOwMF'><b id='vOwMF'><form id='vOwMF'><ins id='vOwMF'></ins><ul id='vOwMF'></ul><sub id='vOwMF'></sub></form><legend id='vOwMF'></legend><bdo id='vOwMF'><pre id='vOwMF'><center id='vOwMF'></center></pre></bdo></b><th id='vOwMF'></th></span></q></dt></tr></i><div id='vOwMF'><tfoot id='vOwMF'></tfoot><dl id='vOwMF'><fieldset id='vOwMF'></fieldset></dl></div>
                2. 本文介绍了如何从特定 id 的 sql 中正确获取国家和其他信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我试图从特定 id 的 sql 获取国家和其他信息,在这两种情况下,只有id"正确显示.

                   0) {while($rows = mysql_fetch_assoc($result)) {回声 $id;回声$国家;}}?>

                  解决方案

                  我认为您有一个名为 id 的列和另一个命名的国家/地区,您希望从中收集某个记录的国家/地区行中的数据.我对一些评论有类似的想法,并想在这个答案中强调我的想法.

                  1. $_GET superglobal 用于从 URL 参数中提取数据.如果它用于从记录中获取数据,您可能需要使用 mysql_fetch_assoc($result)[country"].更多信息请查看https://www.php.net/manual/en/function.mysql-fetch-assoc.php和 https://www.w3schools.com/php/php_superglobals_get.asp>

                  2. 要根据某些输入 id 过滤某些记录,您需要使用 WHERE 子句.更多信息链接:- https://www.w3schools.com/sql/sql_where.asp可能的代码可能是:-

                  <?php$id = $_GET["id"]$sql = "SELECT * FROM `list` WHERE id='$id' ORDER BY category ASC";$result = mysql_query($sql);如果 (mysql_num_rows($result) > 0) {while($rows = mysql_fetch_assoc($result)) {回声 $rows['id'];回声 $rows['country'];}}?>

                  PS:如果提供的信息较少,我已尽力回答所提出的问题.希望有帮助

                  I am trying to get country and other info from sql for specific id, only "id" displays correctly in both cases.

                  <?php
                      $sql = "SELECT * FROM `list`  ORDER BY category ASC";
                      $result = mysql_query($sql);
                      $rows = mysql_fetch_assoc($result);      
                      $id = $_GET['id'];
                      $country = $_GET['country'];
                  
                      echo $id;
                      echo $country;  
                  ?>
                  

                  and

                  <?php
                      $sql = "SELECT * FROM `list`  ORDER BY category ASC";
                      $result = mysql_query($sql);
                      $id = $_GET['id'];
                      $country = $_GET['country'];
                  
                      if (mysql_num_rows($result) > 0) {
                      while($rows = mysql_fetch_assoc($result)) {
                  
                      echo $id;
                      echo $country;  
                      }
                      } 
                  ?>
                  

                  解决方案

                  I think you have a column named id and another named country from which you want to collect the data in the country row of a certain record. I have similar ideas to some of the comments and would like to highlight my thoughts in this answer.

                  1. $_GET superglobal is used to extract data form a URL parameter. If it is used to get the data from the record, you might want to use mysql_fetch_assoc($result)["country"]. For more information, please take a look at https://www.php.net/manual/en/function.mysql-fetch-assoc.php and https://www.w3schools.com/php/php_superglobals_get.asp

                  2. To filter certain records according to some input id, you would want to use the WHERE clause. Link for more information:- https://www.w3schools.com/sql/sql_where.asp The possible code might be:-

                  <?php
                  $id = $_GET["id"]
                  $sql = "SELECT * FROM `list` WHERE id='$id' ORDER BY category ASC";
                  $result = mysql_query($sql);
                  
                  if (mysql_num_rows($result) > 0) {
                      while($rows = mysql_fetch_assoc($result)) {
                          echo $rows['id'];
                          echo $rows['country'];  
                      }
                  } 
                  ?>
                  

                  PS: I have tried my best to answer the asked question provided the less information given. Hope it helps

                  这篇关于如何从特定 id 的 sql 中正确获取国家和其他信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

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

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

                          1. <legend id='Drima'><style id='Drima'><dir id='Drima'><q id='Drima'></q></dir></style></legend>
                              <tbody id='Drima'></tbody>
                            <i id='Drima'><tr id='Drima'><dt id='Drima'><q id='Drima'><span id='Drima'><b id='Drima'><form id='Drima'><ins id='Drima'></ins><ul id='Drima'></ul><sub id='Drima'></sub></form><legend id='Drima'></legend><bdo id='Drima'><pre id='Drima'><center id='Drima'></center></pre></bdo></b><th id='Drima'></th></span></q></dt></tr></i><div id='Drima'><tfoot id='Drima'></tfoot><dl id='Drima'><fieldset id='Drima'></fieldset></dl></div>

                            <small id='Drima'></small><noframes id='Drima'>