I can't seem to make my query work. When I use $sth->execute(); I do get a reading, yet is pretty worthless for my goal as far as I know. If I use query, nothing shows up. Keep in mind that I'm a beginner when it comes to coding. Also, this is a school project and nothing more.
I don't know why the first line of code won't be implemented so look at the row below as part of the code:
$team1 = $_POST['teamname'];
$sth = $pdo->prepare("SELECT odds1 FROM odds WHERE :team1=team1");
$sth->bindParam(':team1', $team1);
$sth->query();
$values = $sth->fetchAll(PDO::FETCH_ASSOC);
echo $values[odds1];