最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

mysql - Parse error: syntax error, unexpected '}' in C:xampphtdocsadminproducts.php on line 148

programmeradmin0浏览0评论
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question
              <tr>
                <?php include('sql_connect.php'); ?>
              <?php
                $sql="select * from hp";
                $query=mysql_query($sql);

               if(mysql_num_rows($query)>0)
                { ?>
                  $i=1; 
                   while ($row=mysql_fetch_object($query)
                   {


                    <th scope="row"><input type="checkbox" /></th>
                    <td class="tm-product-name"><?php echo $hp_model; ?></td>
                    <td><?php echo $hp_type; ?></td>
                    <td><?php echo $hp_colour; ?></td>
                    <td><?php echo $hp_ds; ?></td>
                    <td><?php echo $hp_price; ?></td>

                  <?php } } ?>

                <td>
                  <a href="#" class="tm-product-delete-link">
                    <i class="far fa-trash-alt tm-product-delete-icon"></i>
                  </a>
                </td>
              </tr>
Closed. This question is off-topic. It is not currently accepting answers.

Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third-party plugins and themes are off-topic for this site; they are better asked about at their developers' support routes.

Closed 5 years ago.

Improve this question
              <tr>
                <?php include('sql_connect.php'); ?>
              <?php
                $sql="select * from hp";
                $query=mysql_query($sql);

               if(mysql_num_rows($query)>0)
                { ?>
                  $i=1; 
                   while ($row=mysql_fetch_object($query)
                   {


                    <th scope="row"><input type="checkbox" /></th>
                    <td class="tm-product-name"><?php echo $hp_model; ?></td>
                    <td><?php echo $hp_type; ?></td>
                    <td><?php echo $hp_colour; ?></td>
                    <td><?php echo $hp_ds; ?></td>
                    <td><?php echo $hp_price; ?></td>

                  <?php } } ?>

                <td>
                  <a href="#" class="tm-product-delete-link">
                    <i class="far fa-trash-alt tm-product-delete-icon"></i>
                  </a>
                </td>
              </tr>
Share Improve this question asked Aug 2, 2019 at 1:17 ikaika 11 silver badge1 bronze badge 1
  • you are missing to close brace of while loop. while ($row=mysql_fetch_object($query)) – Chetan Vaghela Commented Aug 2, 2019 at 4:34
Add a comment  | 

1 Answer 1

Reset to default 1

I have updated your code here. so use this below code. you have forgot close this ) in this line like this while ($row=mysql_fetch_object($query))

<tr>
  <?php include('sql_connect.php'); ?>
  <?php
    $sql="select * from hp";
    $query=mysql_query($sql);
   if(mysql_num_rows($query)>0)
    {
      $i=1; 
       while ($row=mysql_fetch_object($query)){ ?>
        <th scope="row"><input type="checkbox" /></th>
        <td class="tm-product-name"><?php echo $hp_model; ?>
  </td>
  <td><?php echo $hp_type; ?></td>
  <td><?php echo $hp_colour; ?></td>
  <td><?php echo $hp_ds; ?></td>
  <td><?php echo $hp_price; ?></td>
  <?php } } ?>
  <td><a href="#" class="tm-product-delete-link"> <i class="far fa-trash-alt tm-product-delete-icon"></i> </a></td>
</tr>
发布评论

评论列表(0)

  1. 暂无评论