undefined index id

Codes here !

Moderators: egami, macek, gesf

Post Reply
New php-forum User
New php-forum User
Posts: 9
Joined: Wed Jul 03, 2013 10:14 pm

Sun Jul 07, 2013 10:32 pm


I am getting the above error on line

$query = "select id,firstname FROM master WHERE id " .$_GET['id'];

$(document).on('click', '.editBtn', function(){
url: 'update_form.php',
data: {'id' : $(this).closest('td').find('.userId').text()},
dataType: 'json',
success: function(data)



php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Jul 08, 2013 3:08 am

you need to validate $_GET['id']. you need to verify if this id has a value. You can use isset() to do this.

Post Reply