diff --git a/public/skills/add.php b/public/add.php old mode 100755 new mode 100644 similarity index 93% rename from public/skills/add.php rename to public/add.php index 743d513..648017f --- a/public/skills/add.php +++ b/public/add.php @@ -11,8 +11,8 @@

Add Skills




-

Proficiency

- @@ -40,7 +40,7 @@ ?> - + diff --git a/public/process.php b/public/process.php index 9b73108..df45249 100755 --- a/public/process.php +++ b/public/process.php @@ -2,7 +2,7 @@ session_start(); if ($_SERVER["REQUEST_METHOD"] === "POST") { $Skill = $_POST['Skill']; - $Proficiency = $_POST['Proficiency']; + $proficiencyLevel = $_POST['proficiencyLevel']; $Experience = $_POST['Experience']; $Description = $_POST['Description']; //adding into the database @@ -22,8 +22,8 @@ echo " Database connected"; } ; try { - $sql= "INSERT INTO skills (Skill, Proficiency, Experience, Description) - VALUES ('$Skill','$Proficiency','$Experience','$Description')"; + $sql= "INSERT INTO skills (Skill, proficiencyLevel, Experience, Description) + VALUES ('$Skill','$proficiencyLevel','$Experience','$Description')"; if(mysqli_query($conn, $sql)){ echo "
New record created successfully"; } @@ -39,14 +39,14 @@ } $Store = [ 'Skill' => $Skill, - 'Proficiency' => $Proficiency, + 'proficiencyLevel' => $proficiencyLevel, 'Experience' => $Experience, 'Description' => $Description ]; $_SESSION['Skill'] = $Store; $Skill = $_SESSION['Skill']; - // echo $Store['Skill'],'
', $Store['Proficiency'],'
',$Store['Experience'],'
',$Store['Description'],'
'; + // echo $Store['Skill'],'
', $Store['ProficciencyLevel'],'
',$Store['Experience'],'
',$Store['Description'],'
'; // displaying the information when only one session is stored foreach ($Store as $value){ diff --git a/public/skills.php b/public/skills.php new file mode 100644 index 0000000..a34d912 --- /dev/null +++ b/public/skills.php @@ -0,0 +1,29 @@ + + connect_error){ + die ('connection failed:' . $conn->connect_error); + } +//fetching data fron the database +$query = "SELECT * FROM skills where user_id = 1"; +$result =mysqli_query($conn, $query); +if(mysqli_num_rows($result)>0){ + while($row = mysqli_fetch_assoc($result)){ + echo $row['name']; + echo $row['proficiencyLevel']; + echo $row['description']; + + } +}else{ +echo "No data skill found on the skill table"; +} +$conn->close(); + // } +?> + + + \ No newline at end of file