Re: catch a sql result and place as a variable, problems.
| From: | Jon Wood | Date: | Mon, 19 Jul 2004 00:30:02 +0000 |
| Subject: | Re: catch a sql result and place as a variable, problems. | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-13737@lists.php.net to get a copy of this message | ||
On Mon, 19 Jul 2004 08:24:28 +0800, Louie Miranda <lmiranda@gmail.com> wrote:
> How can i catch a result on a mysql query and make it as a variable?
>
> ## code, im doing.. ##
> $last_date = "select max(dateposted) from datafiles where office = '"
> .$_SESSION['username']. "'";
>
> $q2 = $db_view->query($last_date);
> if (DB::iserror($q2)) {
> die($q2->getMessage());
> }
> ## end of code ##
>
> How can i get the max(dateposted) result as a variable or global? if
> im going to issue it as a query on PEAR?
>
> Will this work? if i use this?
> DB_Common::getCol() -- Fetch a single column
>
$result = $db_view->getOne($last_date);
...
$result will contain the max(dateposted) value
> pls help, thanks!
>
> --
> Louie Miranda
> http://www.axishift.com
>
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>