Date: 03/15/00
- Next message: Bernhard Bock: "No spam please: [PHPLIB] You can make $800,000 from your PC!"
- Previous message: Michael Anthon: "RE: [PHPLIB] Brain Fart..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
BTW.. I too prefer lists where the mailing list is the return address :)
attached mail follows:
$getsid = new DB_Article;
$query = "select nextval('result_seq')";
$getsid->query($query);
$sid = $getsid->f(0);
$print "HERE::$sid";
I get 'HERE::'.
The query does infact increase the value of result_seq which is expected if
the query is performed properly.
Now, how to get the pesky information back out of the thing.
psql shows:
nextval
----------
10433
(1 row)
I tried $sid = $getsid->f('nextval'); withthe same results.
Michael Anthon wrote:
> *mutter* .. I prefer lists wehre teh return address is the list, not the
> originator 8^)
>
> The column name passed into the db->f() function is actually used as an
> index into an associative array like this...
>
> function f($Name) {
> return $this->Record[$Name];
> }
>
> Therefore, you can simply use an integer (0 based) to return columns. In
> your case, there should be only one column in the result, so
> $variable = $getsid->f(0);
> should give you what you want.
>
> Cheers
> Michael Anthon
>
> > -----Original Message-----
> > From: Rod Taylor [mailto:rodt <email protected>]
> > Sent: Thursday, 16 March 2000 2:26 AM
> > To: phplib <email protected>
> > Subject: [PHPLIB] Brain Fart...
> >
> >
> > Today is one of those days....
> >
> > Queries work fine from tables, but the below is having problems.
> >
> > $getsid = new DB_Article;
> > $query = "select nextval('result_seq')";
> > $getsid->query($query);
> >
> > The query actually works as advertised, but how do I go about getting
> > the returned value?
> >
> > Normally its $variable = $getsid->f("????");
> >
> > But, in this case there is no column name (or is there?).
> >
> > Thanks!
> >
> > -
> > PHP3 Base Library Mailing List. Send messages to
> > <phplib <email protected>>.
> > To unsubscribe, send "unsubscribe" to
> > <phplib-request <email protected>> in
> > the body, not the subject, of your message.
> >
> -
> PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
> To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
> the body, not the subject, of your message.
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Bernhard Bock: "No spam please: [PHPLIB] You can make $800,000 from your PC!"
- Previous message: Michael Anthon: "RE: [PHPLIB] Brain Fart..."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

