undefined index id

Codes here !

Moderators: macek, egami, gesf

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

undefined index id

Post by jagjittcl » 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: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: undefined index id

Post by johnj » 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

Who is online

Users browsing this forum: No registered users and 1 guest