$query = "INSERT INTO music (`ID`,`friendID`,`friendPicture`,`friendName`) VALUES ('$ID','{$friend['id']}','{$friend['picture']}','{$friend['name']}')";
well i need the insert statement and if i remove it i will not get error !!
Is there away to keep the insert and not to get the error. it is just annyoing to get so many of such error
I'm fairly sure that the undefined variable notice had nothing to do with the database, it was because you had not initialised the $ID variable before the query line
The error message was issued because $ID was not initialized.
Many times, database ids are assigned by the database by setting the field up as an autoincrement field, in which case, assigning them is will also cause an error.
In order to be sure removing $ID from the INSERT command was the correct solution (and to avoid future problems) - you should check to see if the ID is an autoincrement field, and if it is supposed to be unique.