Error when trying to edit a form for fields in mysql database

  • (2 Pages)
  • +
  • 1
  • 2

18 Replies - 994 Views - Last Post: 25 March 2015 - 03:53 PM Rate Topic: -----

#1 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:09 AM

Hello, I am trying to edit fields within a database table called 'minutes', there are a number of sets of minutes but the code is working as follows... The session start sets the current user which is used in the queries below (currentUser=Bnumber)... When clicking on the edit button when on the 'viewstudentminutes.php' page it is throwing the following error 'Notice: Undefined index: Minute_ID in viewstudentminutes.php on line 179

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1' in viewstudentminutes.php:179 Stack trace: #0 viewstudentminutes.php(179): PDO->prepare('SELECT * FROM `...') #1 {main} thrown in viewstudentminutes.php on line 179

Below is all the php code on the minutes.php page.
<?php
include ("dbConnect.php");
include ("studenthead.php");

   session_start();
   if (!(isset($_SESSION["sess_username"]))) header ("Location: index.php");
   $currentUser=$_SESSION["sess_username"];   

if (isset($_POST['addMinute'])) {
	$newB_number = $currentUser;
	$newDate = $_POST['Date'];
    $newTime = $_POST['Time'];
	$newDiscussion = $_POST['Discussion'];
	$newActions = $_POST['Actions'];
	$newDateofnextmeeting = $_POST['Dateofnextmeeting'];
	$newStatus = "Submitted";
    $newE_number =  $_POST['E_number'];
 	$newSupervisor_comments = $_POST['Supervisor_comments'];


	
	$dbQuery  = $db->prepare("insert into minute values (null, :newB_number, :newDate, :newTime, :newDiscussion, :newActions, :newDateofnextmeeting,  :newStatus, :newE_number, :newSupervisor_comments )");
	$dbParams = array('newB_number'=>$newB_number, 'newDate'=>$newDate, 'newTime'=>$newTime, 'newDiscussion'=>$newDiscussion, 'newActions'=>$newActions, 'newDateofnextmeeting'=>$newDateofnextmeeting, 'newStatus'=>$newStatus, 'newE_number'=>$newE_number, 'newSupervisor_comments'=>$newSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	$lastInserted = $db->lastInsertId();
}
   
if (isset($_POST['deleteMinuteID'])) {
	$ID = $_POST['deleteMinuteID'];
	
	$dbQuery  = $db->prepare("delete from minute where ID=:ID");
	$dbParams = array('ID'=>$ID);
	$dbQuery->execute($dbParams);
}


if (isset($_POST['editCommitID'])) {
	$ID 	      = $_POST['editCommitID'];
	$editB_number = $_POST['editB_number'];
	$editDate  = $_POST['editDate'];
    $editTime  = $_POST['editTime'];
	$editDiscussion  = $_POST['editDiscussion'];
	$editActions = $_POST['editActions'];
	$editDateofnextmeeting = $_POST['editDateofnextmeeting'];
	$editStatus = $_POST['editStatus'];
    $editE_number = $_POST['editE_number'];
	$editSupervisor_comments = $_POST['editSupervisor_comments'];

	
	$dbQuery  = $db->prepare("update minute set B_number=:B_number, Date=:Date, Time=:Time, Discussion=:Discussion, Actions=:Actions, Dateofnextmeeting=:Dateofnextmeeting, Status=:Status, E_number=:E_number, Supervisor_comments=:Supervisor_comments where ID=:ID");
	$dbParams = array('ID'=>$ID, 'B_number'=>$editB_number, 'Date'=>$editDate, 'Time'=>$editTime, 'Discussion'=>$editDiscussion, 'Actions'=>$editActions, 'Dateofnextmeeting'=>$editDateofnextmeeting, 'Status'=>$editStatus, 'E_number'=>$editE_number, 'Supervisor_comments'=>$editSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	header("location: minutes.php");
	exit();
}


?>


*HTML CODE FOR THE PAGE IS HERE
<?php


	$dbQuery = $db->prepare("select * from minute where '$currentUser'=B_number ");
	$dbQuery->execute();
	
	$numMinutes = $dbQuery->rowCount();

	echo "<p>There are $numMinutes sets of minutes in the system</p>";

	$oddRow=true;
	while ($dbRow = $dbQuery->fetch(PDO::FETCH_ASSOC)) {
		$ID		  = $dbRow['ID'];
    	$B_number = $dbRow['B_number'];
    	$Date  = $dbRow['Date'];
    	$Time  = $dbRow['Time'];
    	$Discussion = $dbRow['Discussion'];
		$Actions = $dbRow['Actions'];
		$Dateofnextmeeting = $dbRow['Dateofnextmeeting'];
		$Status = $dbRow['Status'];
		$E_number = $dbRow['E_number'];
		$Supervisor_comments = $dbRow['Supervisor_comments'];

		
    	if ($oddRow) $rowClass="odd"; else $rowClass="even";
    	$oddRow=!$oddRow;
    
     	if (isset($_POST['editMinuteID']) && $_POST['editMinuteID']==$ID) {
    		echo "<tr class='$rowClass '>
    		      <form style='display:inline' method='post' action='minutes.php'>
    	            <input type='hidden' name='editCommitID' value='$ID'>
    	            <td><input type='varchar' name='editB_number' value='$B_number'></td>
    	            <td><input type='date' name='editDate' value='$Date'></td>
					<td><input type='time' name='editTime' value='$Time'></td>
    	            <td><input type='text' name='editDiscussion' value='$Discussion'></td>
					<td><input type='text' name='editActions' value='$Actions'></td>
					<td><input type='date' name='editDateofnextmeeting' value='$Dateofnextmeeting'></td>
					<td><input type='enum' name='editStatus' value='$Status'></td>
					<td><input type='varchar' name='editE_number' value='$E_number'></td>
					<td><input type='text' name='editSupervisor_comments' value='$Supervisor_comments'></td>
    	            <td colspan='2'><input type='image' src='edit.png'>
    	      	 </form>
    	      	 </tr>";      
    	} else {
		
    		echo "<tr class='$rowClass'><td>$B_number</td><td>$Date</td><td>$Time</td><td>$Discussion</td><td>$Actions</td><td>$Dateofnextmeeting</td><td>$Status</td><td>$E_number</td><td>$Supervisor_comments</td>
    	              <td class='operation'>
    	                 <form class='display:inline' method='post' action='viewstudentminutes.php'>
                         <input type='hidden' name='editMinute_ID' value='$ID'>
                         <input type='image' src='edit.png' style='padding-top:7px'>
                         </form></td>
                      <td class='operation'>
                         <form class='display:inline' method='post' action='minutes.php'   
                         	   onsubmit='return confirm(\"Are you sure?\")'>
                         <input type='hidden' name='deleteMinuteID' value='$ID'>
                         <input type='image' src='delete.png' style='padding-top:7px'>
                         </form></td>
						 <td class='operation'>
                         <form class='display:inline' method='post' action='viewstudentminutes.php' onsubmit='viewstudentminutes.php'>
						<input type='image' src='view.png' style='padding-top:7px'>
						<input type='hidden' name='ID' value='" . $ID . "'>
</form></td>
                  </tr>";
    	}         
	}
					

?>


Below is the php code for the viewminutes.php page
<?php
include ("dbConnect.php");
include ("studenthead.php");

   session_start();
   if (!(isset($_SESSION["sess_username"]))) header ("Location: index.php");
   
   $currentUser=$_SESSION["sess_username"];   

if (isset($_POST['addMinute'])) {
	$newB_number = $currentUser;
	$newDate = $_POST['Date'];
    $newTime = $_POST['Time'];
	$newDiscussion = $_POST['Discussion'];
	$newActions = $_POST['Actions'];
	$newDateofnextmeeting = $_POST['Dateofnextmeeting'];
	$newStatus = "Submitted";
	$newE_number =  $_POST['E_number'];
	$newSupervisor_comments = "  ";
	
	

	
	$dbQuery  = $db->prepare("insert into minute values (null, :newB_number, :newDate, :newTime, :newDiscussion, :newActions, :newDateofnextmeeting, :newStatus, :newE_number, :newSupervisor_comments )");
	$dbParams = array('$newB_number'=>$newB_number, 'newDate'=>$newDate, 'newTime'=>$newTime, 'newDiscussion'=>$newDiscussion, 'newActions'=>$newActions, 'newDateofnextmeeting'=>$newDateofnextmeeting, 'newStatus'=>$newStatus, 'newE_number'=>$newE_number, 'newSupervisor_comments'=>$newSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	$lastInserted = $db->lastInsertId();
}

   
   
if (isset($_POST['editCommitID'])) {
	$ID 	      = $_POST['editCommitID'];
	$editB_number = $_POST['editB_number'];
	$editDate  = $_POST['editDate'];
    $editTime  = $_POST['editTime'];
	$editDiscussion  = $_POST['editDiscussion'];
	$editActions = $_POST['editActions'];
	$editDateofnextmeeting = $_POST['editDateofnextmeeting'];
	$editStatus = $_POST['editStatus'];
	$editE_number = $_POST['editE_number'];
	$editSupervisor_comments = $_POST['editSupervisor_comments'];
	
	
	$dbQuery  = $db->prepare("update minute set B_number=:B_number, Date=:Date, Time=:Time, Discussion=:Discussion, Actions=:Actions, Dateofnextmeeting=:Dateofnextmeeting, Status=:Status, E_number=:E_number, Supervisor_comments=:Supervisor_comments where ID=:ID");
	$dbParams = array('ID'=>$ID, 'B_number'=>$editB_number, 'Date'=>$editDate, 'Time'=>$editTime, 'Discussion'=>$editDiscussion, 'Actions'=>$editActions, 'Dateofnextmeeting'=>$editDateofnextmeeting, 'Status'=>$editStatus, 'E_number'=>$editE_number, 'Supervisor_comments'=>$editSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	header("location: viewstudentminutes.php");
	exit();
}



?>


*HTML CODE FOR THE PAGE*
<?php 
	 
	 		
	$dbQuery= $db->prepare("SELECT * FROM `Minute` WHERE `B_number` = '" . $currentUser . "' AND `ID` = " . $_POST['ID']);
	$dbQuery->execute();
    
		
	$oddRow=true;
	while ($dbRow = $dbQuery->fetch(PDO::FETCH_ASSOC)) {
		$ID		  = $dbRow['ID'];
    	$B_number = $dbRow['B_number'];
    	$Date  = $dbRow['Date'];
    	$Time  = $dbRow['Time'];
    	$Discussion = $dbRow['Discussion'];
		$Actions = $dbRow['Actions'];
		$Dateofnextmeeting = $dbRow['Dateofnextmeeting'];
		$Status = $dbRow['Status'];
		$E_number = $dbRow['E_number'];
		$Supervisor_comments = $dbRow['Supervisor_comments'];

		
    	if ($oddRow) $rowClass="odd"; else $rowClass="even";
    	$oddRow=!$oddRow;
		
		
		  
		if (isset($_POST['editMinuteID']) && $_POST['editMinuteID']==$ID) {
    		echo "<tr class='$rowClass'>
    		      <form style='display:inline' method='post' action='viewstudentminutes.php'>
    	            <input type='hidden' name='editCommitID' value='$ID'>
    	             <tr><td colspan='2'><input type='image' src='edit.png'></tr>
					 <tr><th>MinuteID</th><td><input type='varchar' name='editMinute_ID' value='$ID'></td></tr>
					 <tr><th>BNumber</th><td><input type='varchar' name='editB_number' value='$B_number'></td></tr>
    	            <tr><th>Date</th><td><input type='date' name='editDate' value='$Date'></td></tr>
					<tr><th>Time</th><td><input type='time' name='editTime' value='$Time'></td></tr>
    	            <tr><th>Discussion</th><td><input type='text' name='editDiscussion' value='$Discussion'></td></tr>
					<tr><th>Actions</th><td><input type='text' name='editActions' value='$Actions'></td></tr>
					<tr><th>Date of Next Meeting</th><td><input type='date' name='editDateofnextmeeting' value='$Dateofnextmeeting'></td></tr>
					<tr><th>Status</th><td><input type='enum' name='editStatus' value='$Status'></td></tr>
					<tr><th>E Number</th><td><input type='varchar' name='editE_number' value='$E_number'></td></tr>
					<tr><th>Supervisor Comments</th><td><input type='text' name='editSupervisor_comments' value='$Supervisor_comments'></td></tr>
    	           
    	      	 </form>
    	      	 </tr>";      
    	} else {
    		echo "<tr class='$rowClass'>
					<td class='operation'>
    	                 <form class='display:inline' method='post' action='viewstudentminutes.php'>
                         <input type='hidden' name='editMinute_ID' value='$ID'>
                         <input type='image' src='edit.png' style='padding-top:7px'>
                         </form></td>
					<tr><th>BNumber</th><td>$B_number</td></tr>
					<tr><th>Date</th><td>$Date</td></tr>
					<tr><th>Time</th><td>$Time</td></tr>
					<tr><th>Discussion</th><td>$Discussion</td></tr>
					<tr><th>Actions</th><td>$Actions</td></tr>
					<tr><th>Date of Next Meeting</th><td>$Dateofnextmeeting</td></tr>
					<tr><th>Status</th><td>$Status</td></tr>
					<tr><th>E Number</th><td>$E_number</td></tr>
					<tr><th>Supervisor Comments</th><td>$Supervisor_comments</td></tr>
                  </tr>";
    	}         
	}
	
?>



I know this looks extensive but I was having problems to begin with trying to view an individual set of minutes, and I got that fixed but then the editing function began to throw the error and I just dont know how to fix or adapt the code to allow the user to do both :(/>/>/>/>

This post has been edited by Dormilich: 25 March 2015 - 11:50 AM
Reason for edit:: Added code tags


Is This A Good Question/Topic? 0
  • +

Replies To: Error when trying to edit a form for fields in mysql database

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6247
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:12 AM

Please use CODE TAGS!!!

:code:
Was This Post Helpful? 0
  • +
  • -

#3 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4221
  • View blog
  • Posts: 13,362
  • Joined: 08-June 10

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:18 AM

Quote

When clicking on the edit button when on the 'viewstudentminutes.php' page it is throwing the following error 'Notice: Undefined index: Minute_ID in viewstudentminutes.php on line 179

and how should we find that problem if you don’t post the script part that you know the error is in? since in your posted PHP code there is nowhere a Minute_ID to be seen.

This post has been edited by Dormilich: 25 March 2015 - 11:20 AM

Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6247
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:33 AM

if (!(isset($_SESSION["sess_username"]))) header ("Location: index.php");


Always issue an exit() after a call to header().
Was This Post Helpful? 0
  • +
  • -

#5 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4221
  • View blog
  • Posts: 13,362
  • Joined: 08-June 10

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:36 AM

View PostJackOfAllTrades, on 25 March 2015 - 07:33 PM, said:

Always issue an exit() after a call to header().

a location header. e.g. there shouldn’t be an exit after a content-type header.
Was This Post Helpful? 0
  • +
  • -

#6 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:40 AM

Sorry folks, I am new to this site I shouldve read more about how to post new questions, my bad!!!
The error is on line 4 of the last snippet of code. ('$dbQuery= $db->prepare("SELECT * FROM `Minute` WHERE `B_number` = '" . $currentUser . "' AND `ID` = " . $_POST['ID']);')

' Undefined index: ID' - Again sorry i forgot i was working on the code and tried changing variables
Was This Post Helpful? 0
  • +
  • -

#7 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4221
  • View blog
  • Posts: 13,362
  • Joined: 08-June 10

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:49 AM

you run that portion of the script regardless whether a form was submitted or not and you never check if $_POST['ID'] actually exists.
Was This Post Helpful? 1
  • +
  • -

#8 andrewsw   User is offline

  • head thrashing
  • member icon

Reputation: 6645
  • View blog
  • Posts: 27,200
  • Joined: 12-December 12

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 11:50 AM

Undefined index: ID

$_POST['ID'] doesn't exist, it hasn't been posted. On a quick look it is the form that posts to viewstudentminutes.php that contains an ID element.

Use print_r($_POST) to discover what is in the post-array.

Added: I agree with Dormilich as well, you haven't checked for the existence of the ID element, just assumed it is there.

This post has been edited by andrewsw: 25 March 2015 - 11:52 AM

Was This Post Helpful? 0
  • +
  • -

#9 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 12:39 PM

print_r($_POST) prints 'Array ( [x] => 1 [y] => 13 [ID] => 21 )'. My coding skills are alot to be desired for but from what i take from this is that ID is the correct variable to use? or can anyone post an example of what i should change to allow a user to edit this?
Was This Post Helpful? 0
  • +
  • -

#10 andrewsw   User is offline

  • head thrashing
  • member icon

Reputation: 6645
  • View blog
  • Posts: 27,200
  • Joined: 12-December 12

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:04 PM

Are you printing that in the same page that generates the error, and at the same time as the error occurs? The error says that there is no ID element in the $_POST array.. it doesn't lie ;)

But you haven't addressed the issue mentioned that you are assuming that this array element exists. It will only exist when the page is reached via the forum submission.
Was This Post Helpful? 0
  • +
  • -

#11 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:09 PM

I am so confused now :( as i said im not very good at this lol I have tried editing it completely now. The code below allows the user to edit the minutes however, instead of showing the individual set of minutes the user has clicked on it shows all minutes that the user is involved in. Have you any suggestions on how I can change or add to the code to show (with continuing to allow the user to edit), the set of minutes the user has clicked on and not them all?

The code in the minutes page is the same but the viewstudentminutes page is now this.....

<?php
include ("dbConnect.php");
include ("studenthead.php");

   session_start();
   if (!(isset($_SESSION["sess_username"]))) header ("Location: index.php");
   
   $currentUser=$_SESSION["sess_username"];   

if (isset($_POST['addMinute'])) {
	$newB_number = $currentUser;
	$newDate = $_POST['Date'];
    $newTime = $_POST['Time'];
	$newDiscussion = $_POST['Discussion'];
	$newActions = $_POST['Actions'];
	$newDateofnextmeeting = $_POST['Dateofnextmeeting'];
	$newStatus = "Submitted";
	$newE_number =  $_POST['E_number'];
	$newSupervisor_comments = "  ";
	
	

	
	$dbQuery  = $db->prepare("insert into minute values (null, :newB_number, :newDate, :newTime, :newDiscussion, :newActions, :newDateofnextmeeting, :newStatus, :newE_number, :newSupervisor_comments )");
	$dbParams = array('$newB_number'=>$newB_number, 'newDate'=>$newDate, 'newTime'=>$newTime, 'newDiscussion'=>$newDiscussion, 'newActions'=>$newActions, 'newDateofnextmeeting'=>$newDateofnextmeeting, 'newStatus'=>$newStatus, 'newE_number'=>$newE_number, 'newSupervisor_comments'=>$newSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	$lastInserted = $db->lastInsertId();
}

   
   
if (isset($_POST['editCommitID'])) {
	$ID 	      = $_POST['editCommitID'];
	$editB_number = $_POST['editB_number'];
	$editDate  = $_POST['editDate'];
    $editTime  = $_POST['editTime'];
	$editDiscussion  = $_POST['editDiscussion'];
	$editActions = $_POST['editActions'];
	$editDateofnextmeeting = $_POST['editDateofnextmeeting'];
	$editStatus = $_POST['editStatus'];
	$editE_number = $_POST['editE_number'];
	$editSupervisor_comments = $_POST['editSupervisor_comments'];
	
	
	$dbQuery  = $db->prepare("update minute set B_number=:B_number, Date=:Date, Time=:Time, Discussion=:Discussion, Actions=:Actions, Dateofnextmeeting=:Dateofnextmeeting, Status=:Status, E_number=:E_number, Supervisor_comments=:Supervisor_comments where ID=:ID");
	$dbParams = array('ID'=>$ID, 'B_number'=>$editB_number, 'Date'=>$editDate, 'Time'=>$editTime, 'Discussion'=>$editDiscussion, 'Actions'=>$editActions, 'Dateofnextmeeting'=>$editDateofnextmeeting, 'Status'=>$editStatus, 'E_number'=>$editE_number, 'Supervisor_comments'=>$editSupervisor_comments);
	$dbQuery->execute($dbParams);
	
	header("location: viewstudentminutes.php");
	exit();
}



?>


HTML CODE

<?php 
	 
	$dbQuery = $db->prepare("select * from minute where '$currentUser'=B_number");
	$dbQuery->execute();
	
	$oddRow=true;
	while ($dbRow = $dbQuery->fetch(PDO::FETCH_ASSOC)) {
		$id		  = $dbRow['ID'];
    	$b_number = $dbRow['B_number'];
    	$date  = $dbRow['Date'];
    	$time  = $dbRow['Time'];
    	$discussion = $dbRow['Discussion'];
		$actions = $dbRow['Actions'];
		$dateofnextmeeting = $dbRow['Dateofnextmeeting'];
		$status = $dbRow['Status'];
		$e_number = $dbRow['E_number'];
		$supervisor_comments = $dbRow['Supervisor_comments'];
		
		
    	if ($oddRow) $rowClass="odd"; else $rowClass="even";
    	$oddRow=!$oddRow;
    
		if (isset($_POST['editMinuteID']) && $_POST['editMinuteID']==$id) {
    		echo "<tr class='$rowClass'>
    		      <form style='display:inline' method='post' action='viewstudentminutes.php'>
    	            <input type='hidden' name='editCommitID' value='$id'>
    	            <tr><th>BNumber</th><td><input type='varchar' name='editB_number' value='$b_number'></td></tr>
    	            <tr><th>Date</th><td><input type='date' name='editDate' value='$date'></td></tr>
					<tr><th>Time</th><td><input type='time' name='editTime' value='$time'></td></tr>
    	            <tr><th>Discussion</th><td><input type='text' name='editDiscussion' value='$discussion'></td></tr>
					<tr><th>Actions</th><td><input type='text' name='editActions' value='$actions'></td></tr>
					<tr><th>Date of Next Meeting</th><td><input type='date' name='editDateofnextmeeting' value='$dateofnextmeeting'></td></tr>
					<tr><th>Status</th><td><input type='enum' name='editStatus' value='$status'></td></tr>
					<tr><th>E Number</th><td><input type='varchar' name='editE_number' value='$e_number'></td></tr>
					<tr><th>Supervisor Comments</th><td><input type='text' name='editSupervisor_comments' value='$supervisor_comments'></td></tr>
    	            <tr><td colspan='2'><input type='image' src='edit.png'></tr>
    	      	 </form>
    	      	 </tr>";      
    	} else {
    		echo "<tr class='$rowClass'>
					<td class='operation'>
    	                 <form class='display:inline' method='post' action='viewstudentminutes.php'>
                         <input type='hidden' name='editMinuteID' value='$id'>
                         <input type='image' src='edit.png' style='padding-top:7px'>
                         </form></td>
					<tr><th>BNumber</th><td>$b_number</td></tr>
					<tr><th>Date</th><td>$date</td></tr>
					<tr><th>Time</th><td>$time</td></tr>
					<tr><th>Discussion</th><td>$discussion</td></tr>
					<tr><th>Actions</th><td>$actions</td></tr>
					<tr><th>Date of Next Meeting</th><td>$dateofnextmeeting</td></tr>
					<tr><th>Status</th><td>$status</td></tr>
					<tr><th>E Number</th><td>$e_number</td></tr>
					<tr><th>Supervisor Comments</th><td>$supervisor_comments</td></tr>
                  </tr>";
    	}         
	}
	
?>

Was This Post Helpful? 0
  • +
  • -

#12 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4221
  • View blog
  • Posts: 13,362
  • Joined: 08-June 10

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:13 PM

Quote

instead of showing the individual set of minutes the user has clicked on it shows all minutes that the user is involved in.

because that’s what you have defined in the SQL statement to show.

Quote

Have you any suggestions on how I can change or add to the code to show […], the set of minutes the user has clicked on and not them all?

pass the ID(s) of the minute in question to the script call.
Was This Post Helpful? 0
  • +
  • -

#13 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:20 PM

I have edited my code and i am no longer calling for the individual id in the sql statement...
How do i pass the individual id to the script call?

This post has been edited by Dormilich: 25 March 2015 - 01:25 PM

Was This Post Helpful? 0
  • +
  • -

#14 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4221
  • View blog
  • Posts: 13,362
  • Joined: 08-June 10

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:25 PM

as URL parameter.
Was This Post Helpful? 0
  • +
  • -

#15 ABUUC   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 25-March 15

Re: Error when trying to edit a form for fields in mysql database

Posted 25 March 2015 - 01:28 PM

So no one can post a full example of what i have to change to get this to work....?
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2