Note that there are some explanatory texts on larger screens.

plurals
  1. PONotice: Undefined index: id in C:\xampp\htdocs\
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php">Reference - What does this error mean in PHP?</a> </p> </blockquote> <p>I am trying to establish a database using PHP but I keep getting errors saying I have an undefined index in id.</p> <p>I want to add data into my database, also able to update, delete and show the infomation. This is my update info codes.</p> <pre><code>&lt;?PHP // Connection to MySQL $dbconnection = @mysql_connect('localhost','root',''); if (!$dbconnection) { echo '&lt;p&gt; Unable to connect to the database at this time.&lt;/br&gt;&lt;/br&gt;&lt;/p&gt;'; exit();} else { echo '&lt;p&gt; connection to database is successful&lt;/br&gt;&lt;/br&gt; &lt;/p&gt;';} //select Mysql Database-ijdb if (!@mysql_select_db('disease')){ exit('&lt;p&gt; Unable to locate the information on the database.&lt;/p&gt;'); } //Receive Variables from the GET of JOKELIST.php if(isset($_POST['submit'])) { $GeneticOrganisation=$_POST['newGeneticOrganisation']; $ProteinInformation=$_POST['newProteinInformation']; $Symptoms=$_POST['newSymptoms']; $Population=$_POST['newPopulation']; $Cure=$_POST['newCure']; $OriginOfDisease=$_POST['newOriginOfDisease']; $dmdid=$_POST['id']; // Print receieved variables to check accuracy $sql= "UPDATE dmd SET GeneticOrganisation ='".$GeneticOrganisation."' WHERE id `='".$dmdid."'"; $sql= "UPDATE dmd SET ProteinInformation ='".$ProteinInformation."' WHERE id ='".$dmdid."'"; $sql= "UPDATE dmd SET Symptoms ='".$Symptoms."' WHERE id ='".$dmdid."'"; $sql= "UPDATE dmd SET Population ='".$Population."' WHERE id ='".$dmdid."'"; $sql= "UPDATE dmd SET Cure ='".$Cure."' WHERE id ='".$dmdid."'"; $sql= "UPDATE dmd SET OriginOfDisease ='".$OriginOfDisease."' WHERE id ='".$dmdid."'"; } if (!@mysql_query($sql)) echo "&lt;p&gt; Information could not be updated-".mysql_error(); else{ echo "&lt;p&gt; Information updated successfully"; echo '&lt;a href="diseaseInfo.php"&gt; View the information on the disease here.'; } ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload