Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 844025
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:13:26+00:00 2026-05-15T06:13:26+00:00

‘view_act.php’ file <?php $query = mysql_query(‘select * from activities’); $check=mysql_num_rows($query); if($check==0) { echo No

  • 0
'view_act.php' file

<?php


  $query = mysql_query('select * from activities');
   $check=mysql_num_rows($query);
  if($check==0)
   { 
   echo "No enteries found ";
   }

  else
  {  
     static $counter;
     echo '<table border="1" cellpadding="5" cellspacing="5" align="center">

      <tr>

      <th><font color="#FF9900">ACTIVITY NAME</font></th>
      <th><font color="#FF9900">ACTIVITY UPDATE</font></th>
     </tr>';
     while($row=mysql_fetch_array($query))
     { $counter++;


           echo '<tr>';

           echo '<td width=231>
      <form action="update_act.php" method="POST">';

       echo "<center><font color=\"#CC9900\">".$row['act_name']."</center>";


      echo "</td>
      <td width=231>";
      echo "<center>".'<font color="#CCCCCC"><input type="submit" name="edit"                                 value="edit"></center>';
      echo '<input type="hidden" name="act_name'.$counter.'" value="'.$row['act_name'].'" />';
      echo '<input type="hidden" name="count" value="'.$counter.'" />';


      echo "</td>
       </tr>";
     }
     echo "</form>";
    echo "</table>";


  }         

 ?> 


'update_act.php' file

 <?php
      $count=$_POST['count'];
  echo "Old Activity Name : ". $_POST["act_name".$count];
  echo '<br/>Enter new activity name :
       <form action="update_act.php" method="post">
          <input type="text" name="aname">
     <input type="submit" name="submit">'; 
  ?>

Here data fetched from the table has to be updated through a different name of edit button so for each Activity Name a different name is given by counter.But the problem here is when the form is submitted to the page update_act.php the value of last Activity Name is passed every time.So the value of old Activity Name for any row is the last value of the table ‘act_name’.Please help me out to pass corresponding value of counter for any Activity Name.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:13:27+00:00Added an answer on May 15, 2026 at 6:13 am

    This is a mess.

    If you want to identify specific rows from a table then that should be done on the primary key or a unique surrogate key. Never, NEVER use a counter/rownum/offset.

    • Not even if you force an ORDER BY (some unique key).

    • Not even if you have a transaction spanning the select and update (which is impossible if they occur on seperate pages anyway)

    C.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 535k
  • Answers 535k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Don't put the image in the App_Data folder. Put it… May 17, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer You must use equals() to compare String objects in Java.… May 17, 2026 at 1:07 am
  • Editorial Team
    Editorial Team added an answer You need to separate your parameters with commas! CREATE PROCEDURE… May 17, 2026 at 1:07 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

Does anyone know how can I replace this 2 symbol below from the string
I have just tried to save a simple *.rtf file with some websites and
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am currently running into a problem where an element is coming back from
The problem with unsigned char. I am reading a PPM image file which has
I've got a string that has curly quotes in it. I'd like to replace
i got an object with contents of html markup in it, for example: string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is
I have a JSP page retrieving data and when single or double quotes are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.