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

    1. <small id='jPKOP'></small><noframes id='jPKOP'>

        <bdo id='jPKOP'></bdo><ul id='jPKOP'></ul>
    2. <tfoot id='jPKOP'></tfoot>
      1. <legend id='jPKOP'><style id='jPKOP'><dir id='jPKOP'><q id='jPKOP'></q></dir></style></legend>

        注意:数组到字符串的转换 - PHP &amp;我的SQL

        时间:2023-10-11

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

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

                1. <legend id='ZnLZn'><style id='ZnLZn'><dir id='ZnLZn'><q id='ZnLZn'></q></dir></style></legend>
                  本文介绍了注意:数组到字符串的转换 - PHP &amp;我的SQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我一直在阅读这里与此相关的每个线程,但我总是弄错.

                  I've been reading in every thread in here that is related to this but I always get it wrong.

                  请帮忙,因为我总是收到错误

                  Please help cause I always get the error

                  注意:数组到字符串的转换"在$address[] =mysql_result($row, 0);"

                  "Notice: Array to string conversion" in line "$address[] = mysql_result($row, 0 );"

                  在下面.请帮忙.

                  if ($p_address=mysql_query($email))
                  {
                  $address = array();
                  
                  while($row = mysql_fetch_assoc($p_address))
                  {     
                   $address[] = mysql_result($row, 0 );
                  }  
                  
                  $all_address = implode(',', $address);
                  

                  推荐答案

                  更改此行

                   $address[] = mysql_result($row, 0 );
                  

                  为此:

                   $address[] = $row;
                  

                  然后要查看新的 $address 数组中可用的键和值,您可以执行以下操作:

                  And then to see the keys and values available in the new $address array, you can do something like this:

                   print_r($address);
                  

                  为了保持 implode() 的功能,请执行以下操作:

                  In order to keep implode() functional, do something like this:

                  for ($i = 0; $i < count($address); $i++) {
                    $all_address[] = implode(',', $address[$i]);
                  }
                  

                  最终输出:

                  if ($p_address=mysql_query($email))
                  {
                  $address = array();
                  
                  while($row = mysql_fetch_assoc($p_address))
                  {     
                   $address[] = $row;
                  }
                  
                  for ($i = 0; $i < count($address); $i++) {
                    $all_address[] = implode(',', $address[$i]);
                  }
                  
                  // Example for outputting on screen:
                  foreach ($all_address as $aa) {
                    print $aa . "<br/>
                  ";
                  }
                  }
                  

                  希望有帮助...

                  这篇关于注意:数组到字符串的转换 - PHP &amp;我的SQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:PHPMyAdmin 说:此 MySQL 版本不允许使用所使用的命令 下一篇:PHP 基础 - 在哪里存储 PHP 使用的 MySQL 密码

                  相关文章

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

                  <tfoot id='rNHmp'></tfoot>
                    <bdo id='rNHmp'></bdo><ul id='rNHmp'></ul>

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