I'm using PDO and I'm still wet behind the ears so, here we go:
Here's my search query:
<table width=100% align="center">
//Prepare a select statment with 'named' parameters
$stmt = $db->prepare("SELECT * FROM registration where stage_name LIKE :search");
//setup the data to be passed as the named parameter
$data = array(
'search' => trim($_POST['search'])
//execute the query along with the data
//if a result was returned (i.e there was a match) then assign that record to $row
if ($row = $stmt->fetch(PDO::FETCH_OBJ))
<A HREF="contestant.php?id=<?php echo $row['id']; ?>" target="_blank" class="body"><?php echo stripslashes($row['stage_name']); ?></a>
No errors, but no results.
In other words, there's a row in the database that corresponds to my search query, so I'm getting the table and the "Contestants" header, but no name and no contestant id.
What am I doing wrong?