Only displays a php record

Asked

Viewed 37 times

1

I have a list showing the records in php, and a hidden div that by clicking the link in each record opens this hidden div with a map. But when I add a record with the map link, it only shows a record.

My code is this:

jquery:

  $(function() {
    $(document).on('click', '.caixa .maisinfo a', function() {
        var $this = $(this);

        $this.parent()
            .parent()
                .nextAll( ".mapa:first" ) //Isto vai procurar o mapa a seguir do elemento .caixa
                   .slideToggle();
    });
});

html:

  <?php do { ?>
    <div class="caixa">
      <div class="maisinfo"><a href="javascript:void(0);"><img src="imagens/local.png" width="15" height="20" /></a></div>
    <table width="510" height="72" border="0" cellpadding="0" cellspacing="4">
      <tr>
        <td width="15" rowspan="3" align="left" valign="top"><p>&nbsp;</p></td>
        <td height="31" colspan="2"><span class="style5"><?php echo $row_RS_busca['nome']; ?></span></td>
      </tr>
      <tr>
        <td width="29" height="16" align="left" class="style3"><img src="imagens/tel.png" width="10" height="15" /></td>
        <td width="450" align="left" valign="bottom" class="style6"><?php echo $row_RS_busca['telefone']; ?></td>
      </tr>
      <tr>
        <td height="17" align="left" class="style3"><img src="imagens/local.png" width="10" height="17" /></td>
        <td align="left" valign="top" class="style6"><?php echo $row_RS_busca['endereco']; ?></td>
      </tr>
      </table>
          </div>
    <br/>

    <div class="mapa" style="display:none;"> <?php echo $row_RS_busca['mapa']; ?> </div></div>
      <?php } while ($row_RS_busca = mysql_fetch_assoc($RS_busca)); ?>
  • I believe changing your/while loop to while will solve the problem

  • Your doubt has no connection with css and js, it is a php problem, use the relevant tags to doubt and not to the system. Please post a code that can be played from php+mysql. This may be a problem in the query.

  • I noticed that you are using the code I indicated in the other answer, please if my other answer (in the other question) solved the problem, mark it as correct in the "green" button next to it, if you do not know how to do this access the tour please: http://answall.com/tour

1 answer

0

Problem solved was that the map field in the mysql table was 300 characters long, and the link was more than 300 characters long.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.