skip to Main Content

I am having a problem in fetching records from database using php.But When I simply execute the following query into phpmyadmin sqls o it works but when I try to excute using php then its dipslaying error like this:

“undefined index experience.start”

$experience = "SELECT
experience.start,
experience.finish,
experience.isActive,
experience.title,
experience.nameOfOrgnization,
experienceprofessionnelle.organismeLogoURL,
description.details
FROM experience,description  WHERE experience.ID_EP = description.ID_Description";
$result =  $connection->query($experience);

while($row=$result->fetch_assoc()){


  echo $row["experience.start"];
}

2

Answers


  1. you should use $row[“start”] instant of $row[“experiene.start”] as MYSQL return column name not a table.column name

    Login or Signup to reply.
  2. Try This

    $experience = "SELECT
    experience.start,
    experience.finish,
    experience.isActive,
    experience.title,
    experience.nameOfOrgnization,
    experienceprofessionnelle.organismeLogoURL,
    description.details
    FROM experience,description  WHERE experience.ID_EP = description.ID_Description";
    $result =  $connection->query($experience);
    
    while($row=$result->mysqli_fetch_array()){
    
    
      echo $row["experience.start"];
    }
    

    OR

    $experience = "SELECT
    experience.start,
    experience.finish,
    experience.isActive,
    experience.title,
    experience.nameOfOrgnization,
    experienceprofessionnelle.organismeLogoURL,
    description.details
    FROM experience,description  WHERE experience.ID_EP = description.ID_Description";
    $result =  $connection->query($experience);
    
    while($row=$result->fetch_assoc()){
    
    
      echo $row["start"];
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search