Undefined Index in even with if(isset($_POST[.....

Closed
Needhelp123 - Jun 10, 2018 at 12:18 PM
Ambucias Posts 47310 Registration date Monday February 1, 2010 Status Moderator Last seen February 15, 2023 - Jun 10, 2018 at 05:31 PM
I have my IT exam tomorrow and I am stuck with this problem. I still get the Undefinex Index error in php even with the "if(isset.." code. How can I fix this?
This is where my mistakes are. PS the names etc are in norwegian, but ignore them.

$tilkobling->set_charset("utf8");
if(isset($_POST["leggtil"])){

$RID = $_POST["RusseID"];
$F = $_POST["Fornavn"];
$E = $_POST["Etternavn"];
$K = $_POST["Kontaktinformasjon"];
$RN = $_POST["Registreringsnummer"];
$KI = $_POST["Kjøretøyinformasjon"];
$KT = $_POST["Kjennetegn"];
$TM = $_POST["Transportmiddel"];
$RG = $_POST["Gruppenavn"];
}

$sql ="SELECT russen.RusseID,russen.fornavn,russen.etternavn,russen.kjoretoyID, russekjoretoy.Kjoretoymiddel,russekjoretoy.Registreringsnummer, russekjoretoy.Kjoretoyinformasjon,russekjoretoy.Gruppenavn, russekjoretoy.Farge FROM russekjoretoy, russen WHERE russen.kjoretoyID LIKE russekjoretoy.kjoretoyID";

$resultat= $tilkobling->query($sql);

echo "<h1> OVERSIKT OVER RUSSEN </h1>";
echo "<table>";
echo "<tr>";
echo "<th>RusseID</th>";
echo "<th>Fornavn</th>";
echo "<th>Etternavn</th>";
echo "<th>Transportmiddel</th>";
echo "<th>Registreringsnummer</th>";
echo "<th>Kjoretoyinformasjon</th>";
echo "<th>Russegruppe</th>";
echo "</tr>";

While($rad = $resultat->fetch_assoc())
{
$RID = $rad["RusseID"];
$F = $rad["Fornavn"];
$E = $rad["Etternavn"];
$TM = $rad["kjoretoymiddel"];
$RN = $rad["Registreringsnummer"];
$KI = $rad["Kjoretoyinformasjon"];
$RG = $rad["Gruppenavn"];
Related:

1 response

Ambucias Posts 47310 Registration date Monday February 1, 2010 Status Moderator Last seen February 15, 2023 11,162
Jun 10, 2018 at 05:31 PM
Sorry

CCM does not offer help for studies. You must earn your own marks.
0