Re: AW: [phplib] the "Group by" Function Problem From: Jesse Swensen (swensenj <email protected>)
Date: 11/24/00

Maybe I am not seeing it, but where is the $db->next_record command? Even
though you have called query(), all it does is execute the query. You have
to use the next_record() function to actually get the data and populate the
variables used by $db->f("whatever").

-- 
Jesse Swensen
swensenj <email protected>

> From: Michael Zeidler <web_style <email protected>> > Date: Fri, 24 Nov 2000 21:23:01 +0100 > To: <rquinn <email protected>>, "PHPLIB" <phplib <email protected>> > Subject: Re: AW: [phplib] the "Group by" Function Problem > > Sorry Dudes, > > but I have tried the two shown statements : > > "SELECT MAX(demo_ID) MAXDEMOID FROM Match_demo" > "SELECT MAX(demo_ID) AS MAXDEMOID FROM Match_demo" > > but $db->f("MAXDEMOID") gives nothing back .... grrrrr > > I will show you my code so you maybe see another stupid mistake !?!?! > > $query = "SELECT MAX(demo_ID) MAXDEMOID FROM Match_demo"; > > if($db->query($query)){ > $max_rec_id = $db->f("MAXDEMOID"); > my_error("MAXDEMOID : ", $max_rec_id); > } > else{ > if($debug_db) > my_error($methodname, "Query : $query"); > } > > > RESULT :) -----> Error: MAXDEMOID : : > > Am I blind ??? > __________________________________________________________________________ > > > At 17:29 24.11.00 +0100, rquinn <email protected> wrote: >> If I may (as a newcomer to this list) respond: >> >> I use a slightly modified select statement, in the form of: >> >> SELECT MAX(demo_id) AS MAXDEMOID FROM Match_demo; >> echo $db->f("MAXDEMOID"); >> >> The Alias does the trick. >> >> - Rich >> >> --------------------- >> Richard Quinn www.richardquinn.de >> rquinn <email protected> >> >> 0173 - 664 1468 >> 24h: Voicebox:0180/505254647774 Fax:0180/505254647774 >> >> >>> -----Ursprüngliche Nachricht----- >>> Von: Michael Zeidler [mailto:web_style <email protected>] >>> Gesendet: Freitag, 24. November 2000 17:01 >>> An: phplib <email protected> >>> Betreff: [phplib] the "Group by" Function Problem >>> >>> >>> Hi my friends, >>> >>> this problem is rather a MySQL Statement problem than a phplib problem. >>> But I want to use the $db->f() function :))). >>> >>> When I want to get the highest value of a column of a table the following >>> statement would return the right output on the mysql-client. >>> >>> SELECT MAX(demo_id) FROM Match_demo; >>> >>> But how can I get a useable result returned as a row that I can get the >>> highest value of >>> column by using the $db->f("demo_id") function ??? >>> >>> The statement above doesnt return a row, so the f()-functione >>> wouldn´t fit >>> here ! >>> >>> Thank you for help ! >>> >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: phplib-unsubscribe <email protected> >>> For additional commands, e-mail: phplib-help <email protected> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: phplib-unsubscribe <email protected> >> For additional commands, e-mail: phplib-help <email protected> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: phplib-unsubscribe <email protected> > For additional commands, e-mail: phplib-help <email protected> > >

--------------------------------------------------------------------- To unsubscribe, e-mail: phplib-unsubscribe <email protected> For additional commands, e-mail: phplib-help <email protected>