I am a php newbie.
I am doing a sports site, and trying to get the team name to display in an admin area.
I have tried the code below and many variations of it, however it continues to error the message :
Notice: Undefined index: team in ... on line 45
Why is this happening? I have a column in the admin table set up as team, so I am lost to what I have done wrong.
All I want to do is set the team name in the variable $teamName, so I can call to it on the pages needed.
$username = $_POST['username']; $sql = "SELECT team FROM admin WHERE username='$username'"; $pds = $conn->prepare($sql); $pds->execute(array($_POST['team'])); $teamName = $_POST['team'];
Thanks for your help.