inVINCEable
06-08-2007, 09:51 PM
I just created a script that allows me to update values in my database with the help of a friend. I understand everything perfectly except this first part of the update script, and a variable it utilizes, called ['id]. Here is the first part of the script...
if ((isset($_GET['id'])) && (is_numeric($_GET['id']))) {
$id = $_GET['id'];
}
Now I understand what it does, I just do not understand where this 'id' variable is coming from since I have not defined any id variable throughout my scripts on this project.
My guess is it is coming through this part of my code:
<td><a href="edit_user.php?id=' .$row['user_id'] .'">Edit</a></td>
So am I setting a variable here when I use the ?id= in the above code?
So if I renamed this to:
<td><a href="edit_user.php?alternativevariable=' .$row['user_id'] .'">Edit</a></td>
If I renamed it then my new variable would be ['alternativevariable'] ?
Any guidance or help is greatly appreciated because I just do not understand where this ['id] variable is coming from.
Thanks.
Then my
if ((isset($_GET['id'])) && (is_numeric($_GET['id']))) {
$id = $_GET['id'];
}
Now I understand what it does, I just do not understand where this 'id' variable is coming from since I have not defined any id variable throughout my scripts on this project.
My guess is it is coming through this part of my code:
<td><a href="edit_user.php?id=' .$row['user_id'] .'">Edit</a></td>
So am I setting a variable here when I use the ?id= in the above code?
So if I renamed this to:
<td><a href="edit_user.php?alternativevariable=' .$row['user_id'] .'">Edit</a></td>
If I renamed it then my new variable would be ['alternativevariable'] ?
Any guidance or help is greatly appreciated because I just do not understand where this ['id] variable is coming from.
Thanks.
Then my