473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Error in updating learner information

Hello everyone,

I am confused with these little codes why it keeps error in updating the learner information. These are my codes so far.
These are the bits of Student_Info.php which i think would be useful in my query.

Expand|Select|Wrap|Line Numbers
  1. <?php  if(!empty($_GET['flag']) && $_GET['flag'] == "success") { ?>   
  2.         <span class="stylered style1"><span class="style5">Learner Information updated successfully.</span></span>  
  3.         <?php } else if(!empty($_GET['flag']) && $_GET['flag'] == "error") { ?>
  4.         <span class="stylered style3 style5"><span class="style1">Error while updating Learner Information. Please try again</span></span> 
  5.         <?php }  ?>  </td>
  6.  
This is the Student_Edit_Handler codes.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     session_start();
  3.     $session_id = $_SESSION['user_id'];
  4.     if($session_id == null){
  5.        header("location:Student_Edit.php");
  6.        die();
  7.     }
  8.     include 'Connect.php';
  9.     $flag = "";
  10.     $student_id = $_POST['student_id'];
  11.     $first_name = $_POST['first_name'];
  12.     $last_name = $_POST['last_name'];
  13.     $gender = $_POST['gender'];
  14.     $date_of_birth = date("Y-m-d",strtotime($_POST['date_of_birth']));
  15.     $contact_no = $_POST['contact_no'];
  16.     $grade  = $_POST['grade'];
  17.     $section = $_POST['section'];
  18.     $LRN = $_POST['LRN'];
  19.     $email1 = $_POST['email1'];
  20.     $email2 = $_POST['email2'];
  21.     $address = $_POST['address'];
  22.     $description = $_POST['description'];
  23.     $query = "UPDATE student_information SET learner_id='$learner_id',first_name='$first_name',last_name='$last_name',";    
  24.     $query .= "gender='$gender',date_of_birth='$date_of_birth',contact_no='$contact_no',grade='$grade',section='$section',";
  25.     $query .= "LRN='$LRN',email1='$email1',email2='$email2',address='$address',description='$description'";     
  26.     $query .= " WHERE student_id='{$_SESSION['user_id']}'";      
  27.     $result = mysql_query($query, $link_id);
  28.     if(mysql_error() != null){
  29.         die(mysql_error());
  30.         }
  31.     else{
  32.             $flag="error";
  33.         }
  34.         if($flag == "success"){
  35.             mysql_query(" COMMIT ");
  36.             $flag="success";
  37.             if(mysql_error() != null){
  38.                 die(mysql_error());
  39.             }
  40.         }
  41.     header("location:Student_Edit.php?flag=$flag&student_id='{$_SESSION['user_id']}'");   
  42. ?>
  43.  
It flags the error on else{$flag="error";}

I am stuck with these codes guys, please do help me modify it so learner information will be update.
Jul 3 '14 #1

✓ answered by Dormilich

why it keeps error in updating the learner information.
and what are those errors?

2 1127
Dormilich
8,658 Expert Mod 8TB
why it keeps error in updating the learner information.
and what are those errors?
Jul 4 '14 #2
hello dormilich,

thank you for the reply.
It dont give me any notifications but it wont just update.
But anyways, i already solve it my own dormilich.

See you in my next problem to encounter.
Jul 5 '14 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Phil | last post by:
Hi, I'm new to '.net'. I'm working in vb.net and have an error don't know the cause of or how I should go about debugging it. Here is the code: Dim dsNwind As New DataSet Dim daProds As New...
1
by: Nitin | last post by:
i dont know , what's the reson of this, but if i complile my solution in release mode , it works , but give buid error in Debug mode -- "Unexpected error creating debug information file .pdb"....
0
by: Ray Stevens | last post by:
"Server encountered an internal error. For more information, turn off customErrors in the server's .config file." That is not a particularly useful error message. It is being thrown by a...
1
by: Ray Stevens | last post by:
"Server encountered an internal error. For more information, turn off customErrors in the server's .config file." The above is not a particularly helpful error message. It is being thrown by a...
0
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain,...
3
by: Nathan Sokalski | last post by:
I am recieving the following error on the second postback of a page I have written: The state information is invalid for this page and might be corrupted Stack Trace: ...
3
by: Trez | last post by:
Hey guys, Am new at using ASP.Net. am having some problems updating my SQL DB. whenever i try i get this Error. Can someone help me? Incorrect syntax near 'nvarchar'. Description: An unhandled...
2
by: vishwaskothari | last post by:
when i click on the print button of the datareport there comes the msgbox "Error Obtaining Printer Information " what can be the reason ???? TIA regards vishwas
2
by: Smurfas | last post by:
What's wrong? Compiletor don't show anything, but whet I start program show this error: "Error updating the employee details!" protected void Button1_Click(object sender, EventArgs e) ...
3
by: tculley | last post by:
I have a table in Access linked to a SharePoint list. The table is comprised of about 15 fields whose contents are originally pulled from another data source (in Excel format). There are an...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.