473,549 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Undefined index: learner_id

20 New Member
I have made this codes that registers the students using their learner id. And of course i wanted to make sure that there will be no duplication of learner id as students registered.Thes e are my codes.
Expand|Select|Wrap|Line Numbers
  1.     /*
  2.         This block is used to check whether the student_id already exists in database. 
  3.     */
  4.     $select_query="select student_id from student_information where learner_id = '$learner_id'";
  5.     $result_set = mysql_query($select_query,$link_id);
  6.  
  7.     if($row = mysql_fetch_array($result_set)){
  8.         $flag="exists";
  9.         header("location:Student_login.php?flag=$flag&student_id=$student_id");
  10.         die();
  11.     }
  12.     else{
  13.         /*
  14.             This block is used to insert the learners record in database 
  15.             if the student_id is not yet registered in the database. 
  16.         */
  17.         mysql_query("SET AUTOCOMMIT = 0 ");
  18.         if(mysql_error() != null){
  19.             die(mysql_error());
  20.         }    
  21.  
Everytime there is a duplication of learner id by using this code on the other page.
Expand|Select|Wrap|Line Numbers
  1. >This Learner Id( <?php $_GET['learner_id'] ?> ) already exists. Please try again with another Learner Id.</td>
  2.  
The log in page give me notice

This Learner Id(
Notice: Undefined index: learner_id in C:\xampp\htdocs \a\Student_logi n.php on line 61
) already exists. Please try again with another Learner Id.

How do i fix this one. Please advise.
Jul 15 '14 #1
5 1484
Bharat383
93 New Member
Please check your table's learner_id collumn is set as unique or primary key then you have to set as not null.
Jul 15 '14 #2
hanspeare
20 New Member
@Bharat383

Yes already did.
Jul 16 '14 #3
Bharat383
93 New Member
would you put here your table structure.
Jul 29 '14 #4
Rabbit
12,516 Recognized Expert Moderator MVP
Actually, the error is saying that your $_GET array does not have anything called learner_id.
Jul 29 '14 #5
omerbutt
638 Contributor
the page where you are trrying to show the message the expression
Expand|Select|Wrap|Line Numbers
  1. <?php $_GET['learner_id']?>
  2.  
the page cannot detect any set index named learner_id in the $_GET array , verify that when you land or access that page are you sending the learner_id via GET, either you are using form , or using the query string please show the complete code.
regards,
Omer Aslam
Aug 12 '14 #6

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

Similar topics

1
108828
by: lawrence | last post by:
I just switched error_reporting to ALL so I could debug my site. I got a huge page full of errors. One of the most common was that in my arrays I'm using undefined offsets and indexes. These still work fine, but with error reporting at all they are marked as errors. Why? What am I doing wrong? www.monkeyclaus.org
5
10873
by: news.bigpond.com | last post by:
getting errors Notice: Undefined index: name in F:\uni\Software engineering\assignment4\guestbook.php on line 6 the variable $name is declared as $name = _POST; What could be causing this? I've recently installed php 5 on IIS with mysql 4. All running on windows XP
4
7174
by: John Oliver | last post by:
PHP Notice: Undefined index: name in /home/www/reformcagunlaws.com/new.php on line 6 PHP Notice: Undefined index: address in /home/www/reformcagunlaws.com/new.php on line 7 PHP Notice: Undefined index: city in /home/www/reformcagunlaws.com/new.php on line 8 PHP Notice: Undefined index: county in...
3
4958
cassbiz
by: cassbiz | last post by:
Here are the errors that are coming up in my error_log Notice: Undefined index: andatum in /zipcode.php on line 11 Notice: Undefined index: andatum in /zipcode.php on line 12 Notice: Undefined index: abdatum in /zipcode.php on line 13 Notice: Undefined index: zimmer in /zipcode.php on line 14 Notice: Undefined index: city in /zipcode.php...
3
5485
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice: Undefined index: FriendName in D:\Yan\Over_8\SendEmail.php on line 4, Notice: Undefined index: FriendEmail in D:\Yan\Over_8\SendEmail.php on line 5,...
15
4452
by: bill | last post by:
I am trying to write clean code but keep having trouble deciding when to quote an array index and when not to. sometimes when I quote an array index inside of double quotes I get an error about enased whitespace (to my best memory) AT other times I get an undefined index notice as below: Notice: Undefined index: last_reminder_id in...
5
7172
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my local server it was working fine but giving some errors those are Notice: Undefined index: phplogin in C:\Inetpub\wwwroot\sampleft\index.php on line...
3
3861
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if (empty($info)) { $info='noinfo'; } changeinfo($info); Hey everyone, I keep getting an error regarding the above code. These are the errors: ...
3
5978
by: razvanel442 | last post by:
Hi all i am new here! I take a look on forum but i don't found a the answer for my problem ok this is my problem: Line47:$user = $_GET; Line48:$pass = $_GET; Line49:$char = $_GET;
3
2017
by: mediator | last post by:
Hello I have a php contact email form on my a ecommerce shop website ! I am getting a Undefined index error messages coming from the top of the php code, the email form its self works fine, HERE IS THE ERROR MESSAGES Notice: Undefined index: Name in E:\domains\t\tools2diy.co.uk\user\htdocs\contact.php on line 13 Notice: Undefined...
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7446
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7715
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7469
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5368
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
757
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.