newbie PDO question...
I think (hard to tell - buried in a wrapper class) I am doing a select query using:
PDO::FETCH_ASSOC
wrapper:
return $pdostmt->fetchAll(PDO::FETCH_ASSOC);
I am getting back just 1 record - like to display the results of just current customer....
My query is:
$results = $db->select("mytable", "id = 201"); //just 1 exact record)
then I can loop like:
foreach ($results as $result) {
....
?>
<tr>
<td><?php echo $result["First"]; ?></td>
<td><?php echo $result["Last"]; ?></td>
<td><?php echo $result["id"]; ?></td>
</tr>
This all works fine, but since I only have 1 exact CUSTOMER record - I don't need to LOOP anything.
My question is:: How do I display the columns without a loop?
The following failed:
echo $results["First"];
echo $results["First"][0];
echo $results["First"][1];
So what can I use to make it work?