newbie PDO query display question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

newbie PDO question...

I think (hard to tell - buried in a wrapper class) I am doing a select query using  - PDO::FETCH_ASSOC like...

wrapper ------ return $pdostmt->fetchAll(PDO::FETCH_ASSOC);

---

so my query is like...

$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 record - I don't need to LOOP anything - so...

Q: How do I display the columns without a loop


these fail - so what will work

echo $results["First"];
echo $results["First"][0]; ???
echo $results["First"][1]; ???





--
Thanks,
Dave
rev@xxxxxxxxxxx
[db-3]




--
Thanks,
Dave - DealTek
dealtek@xxxxxxxxx
[db-3]


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux