Jump to content

rooz999

New Members
  • Posts

    1
  • Joined

  • Last visited

rooz999's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to update data row But the problem is that it is updated All rows this is my code: $query = mysql_query("SELECT * FROM emp JOIN inv ON emp.name=inv.empname WHERE inv.empname='".$name."'") or die ("mysql error query"); $id = $_POST['id']; $updatestartdate = date('d/m/Y'); $updateenddate = date('d/m/Y'); $status = $_POST['status']; while ($rowshow = mysql_fetch_assoc($query)){ $timetoshow = unix_time($rowshow['timex']); //UPDATE if (isset($_POST['Update']) and $_POST['Update'] == 'dataupdate'){ $updatestatus = mysql_query ("UPDATE inv SET updatestartdate='$updatestartdate', updateenddate='$updateenddate', status='$status' WHERE id='".$rowshow['id']."'") or die ("updatestatus Error"); if (isset ($updatestatus)){ echo "<div class='hidecontent'><h3 style='background-color:#3F3F3F; padding:5px;' align='center'> <font color='#FFFFFF'>Update is done</font></h3><meta http-equiv='Refresh' content='5; url=cpanel_user.php' /></div>"; } else { echo "<div class='hidecontent'><h3 style='background-color:#FF0000; padding:5px;' align='center'> <font color='#FFFF00'>Update Error</font></h3></div>"; } } Where is the problem?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.