Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

224
Views
Changing style of link after sql query in php file

working on some html/css/php/js/sql project and faced the problem - i cant change style of PHP/SQL-generated links, i want to change background of link if its clicked and not changing it after page refresh. I tried different methods including ajax query, but it changes style of every link at same time and lasts on page refresh
PHP file:

if (isset($_GET['move'])) {
     $swi = $_GET['move'];
     $query = "INSERT INTO done
      SELECT * FROM tasks WHERE keycode=$swi";
     mysqli_query($sql, $query) or 
     die(mysqli_error($sql));
     }
foreach ($data as $elem) {
     $datef = explode('-', $elem['date']);
     $dayf = intval($datef[0]);
   $monthf = intval($datef[1]);
   if ($monthf==12){
     $monthf=0;
   } 
   $result .= '<div class="taskboxitem" style="color: #fff">';  
   $result .= '<div class="taskboxhead">'.$dayf.' '.$month[$monthf].'</div>';
   $result .= '<div class="taskboxcontent">' . $elem['task'];
   $result .= '<div class="taskdelete">
   <a href="?del='. $elem['keycode'] . '">
   <ion-icon class="icon" name="trash-outline"></ion-icon>
   Delete</a>
   <a href="?move='.$elem['keycode'].'" class="move" onclick=""> //need this link to change style
   <ion-icon name="checkmark-circle-outline"></ion-icon>Done</a>
   </div></div>';
   $result .= '</div>';}
   echo $result;

Need your help guys!
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!