I'm creating a script that allows a user to delete users in their buddylist. I'm displaying all the users next to a checkbox where when checked and submitted the user will be deleted. But I keep getting this error:
Notice: Undefined index: profile_name
Notice: Undefined index: profile_name
Notice: Undefined index: profile_name
username
Displays this error three times then list the username.
Heres the line thats giving me the error:
print "\t<td><input type=\"checkbox\" name=\"delete[]\" value=\'" . $row['profile_name'] . "\' /></td>\n";
And heres the whole code:
$sql = mysql_query("SELECT * FROM profiles WHERE user='username'") or die(mysql_error());
while ($row = mysql_fetch_row($sql)) {
print "<tr>\n";
foreach ($row as $field)
print "\t<td><input type=\"checkbox\" name=\"delete[]\" value=\'" . $row['profile_name'] . "\' /></td>\n";
print "\t<td>$field</td>\n";
print "</tr>\n";
Thank you for your time.