I am trying to understand why I get this error:
Notice: Undefined index: id in E:\xampp\htdocs\CVToolGismo\addCV.php on line 472
The part of the code that I get the error is this:
if($query = mysql_query("SELECT job_title,company,website,start_date,end_date,start_year,end_year,work_history FROM work WHERE username='$username' order by id asc limit 1") or die(mysql_error())){
                  if(mysql_num_rows($query)>0){
                    while($row = mysql_fetch_array($query)) {
                         $id = $row['id'];
                    }
                  }
                  else{
                      echo '<script>ErrorMessage()</script>';
                  }
              }
 
     
     
    