Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Murray *TMM* #1
Loading a recordset at the last record?
How can I do that? I have a table with record that are updated periodically
through the day. I want a page that only loads the last record. How?
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
Murray *TMM* Guest
-
recordset query to display record title hyperlinked
Hi all, If anybody could please help me i would be most greatful! I have started builiding a front end website connected to a mysql database... -
JavaScript error while loading Recordset.htm
After setting up my testing server (which uses PHP) I tried to create a recordset but get this error... Javascript error while loading... -
Showing a specific record from a recordset
Hi, I am trying to find a way of displaying a specific record (the latest one entered by a user) from a recordset as opposed all of the records or... -
RecordSet.Move or RecordSet.AbsolutePosition??
Hi, I'm trying to use either one of these methods to position the cursor in a specific position inside a recordset, but neither one seems to... -
Stop adding record in subform after record count = 1
Can someone help in in what to put after the THEN statment to allow one entry if the Record count is =>1 in the Before insert or should I set the... -
David Powers #2
Re: Loading a recordset at the last record?
Murray *TMM* wrote:
SELECT * FROM mytable> How can I do that? I have a table with record that are updated periodically
> through the day. I want a page that only loads the last record. How?
ORDER BY primary_key DESC
LIMIT 1
That's the MySQL way, the LIMIT clause may be different on other flavours.
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest
-
Murray *TMM* #3
Re: Loading a recordset at the last record?
Hmm - I don't see that in SQL, David. I'm using an Access database....
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"David Powers" <dp@example.com> wrote in message
news:d5l4ln$4kc$1@forums.macromedia.com...> Murray *TMM* wrote:>>> How can I do that? I have a table with record that are updated
>> periodically through the day. I want a page that only loads the last
>> record. How?
> SELECT * FROM mytable
> ORDER BY primary_key DESC
> LIMIT 1
>
> That's the MySQL way, the LIMIT clause may be different on other flavours.
>
> --
> David Powers
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> Co-author "PHP Web Development with DW MX 2004" (Apress)
> [url]http://computerbookshelf.com[/url]
Murray *TMM* Guest
-
Julian Roberts #4
Re: Loading a recordset at the last record?
Something like
select * from t order by id desc
--
Jules
[url]http://www.charon.co.uk/charoncart[/url]
Charon Cart 3
Shopping Cart Extension for Dreamweaver MX/MX 2004
Julian Roberts Guest
-
David Powers #5
Re: Loading a recordset at the last record?
Murray *TMM* wrote:
How strange that it doesn't have a way to limit the number of records> Hmm - I don't see that in SQL, David. I'm using an Access database....
retrieved. Just leave off the limit clause, and select the first record.
Because they're presented in descending order, the first will be the
last, if you see what I mean.
--
David Powers
Author, "Foundation PHP 5 for Flash" (friends of ED)
Co-author "PHP Web Development with DW MX 2004" (Apress)
[url]http://computerbookshelf.com[/url]
David Powers Guest
-
Murray *TMM* #6
Re: Loading a recordset at the last record?
Ahh - that makes sense. That's basically what Jules suggested, too.
Thanks!
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"David Powers" <dp@example.com> wrote in message
news:d5lihs$ke4$1@forums.macromedia.com...> Murray *TMM* wrote:>>> Hmm - I don't see that in SQL, David. I'm using an Access database....
> How strange that it doesn't have a way to limit the number of records
> retrieved. Just leave off the limit clause, and select the first record.
> Because they're presented in descending order, the first will be the last,
> if you see what I mean.
>
> --
> David Powers
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> Co-author "PHP Web Development with DW MX 2004" (Apress)
> [url]http://computerbookshelf.com[/url]
Murray *TMM* Guest
-
Murray *TMM* #7
Re: Loading a recordset at the last record?
Yep - makes sense indeed. Thanks, Jules.
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"Julian Roberts" <newsg@charon.co.uk> wrote in message
news:d5lh1r$ioq$1@forums.macromedia.com...> Something like
>
> select * from t order by id desc
>
> --
> Jules
> [url]http://www.charon.co.uk/charoncart[/url]
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
Murray *TMM* Guest
-
RomanJ #8
Re: Loading a recordset at the last record?
Hey Murray, for future reference, you could also do something like this:
SELECT * from tablename
WHERE primarykey = (SELECT MAX(primarykey) FROM tablename)
The page will always execute quickly because the database returns just one
record--the one you need--instead of the entire table.
-Roman
"Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
news:d5ljch$lgh$1@forums.macromedia.com...> Ahh - that makes sense. That's basically what Jules suggested, too.
>
> Thanks!
>
> --
> Murray --- ICQ 71997575
> Team Macromedia Volunteer for Dreamweaver
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
> [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
> [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
> [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
> ==================
>
> "David Powers" <dp@example.com> wrote in message
> news:d5lihs$ke4$1@forums.macromedia.com...>>> Murray *TMM* wrote:>>>>> Hmm - I don't see that in SQL, David. I'm using an Access database....
>> How strange that it doesn't have a way to limit the number of records
>> retrieved. Just leave off the limit clause, and select the first record.
>> Because they're presented in descending order, the first will be the
>> last, if you see what I mean.
>>
>> --
>> David Powers
>> Author, "Foundation PHP 5 for Flash" (friends of ED)
>> Co-author "PHP Web Development with DW MX 2004" (Apress)
>> [url]http://computerbookshelf.com[/url]
>
RomanJ Guest
-
Murray *TMM* #9
Re: Loading a recordset at the last record?
Nice - that's a great idea. Thanks, Roman!
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"RomanJ" <this@isfake.com> wrote in message
news:d5lmpq$pgj$1@forums.macromedia.com...> Hey Murray, for future reference, you could also do something like this:
>
> SELECT * from tablename
> WHERE primarykey = (SELECT MAX(primarykey) FROM tablename)
>
> The page will always execute quickly because the database returns just one
> record--the one you need--instead of the entire table.
>
> -Roman
>
>
> "Murray *TMM*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:d5ljch$lgh$1@forums.macromedia.com...>>> Ahh - that makes sense. That's basically what Jules suggested, too.
>>
>> Thanks!
>>
>> --
>> Murray --- ICQ 71997575
>> Team Macromedia Volunteer for Dreamweaver
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> [url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
>> [url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
>> [url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
>> [url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
>> ==================
>>
>> "David Powers" <dp@example.com> wrote in message
>> news:d5lihs$ke4$1@forums.macromedia.com...>>>>> Murray *TMM* wrote:
>>>> Hmm - I don't see that in SQL, David. I'm using an Access database....
>>>
>>> How strange that it doesn't have a way to limit the number of records
>>> retrieved. Just leave off the limit clause, and select the first record.
>>> Because they're presented in descending order, the first will be the
>>> last, if you see what I mean.
>>>
>>> --
>>> David Powers
>>> Author, "Foundation PHP 5 for Flash" (friends of ED)
>>> Co-author "PHP Web Development with DW MX 2004" (Apress)
>>> [url]http://computerbookshelf.com[/url]
>>
>
Murray *TMM* Guest
-
Marja Ribbers #10
Re: Loading a recordset at the last record?
Access does not support 'limit 1' but does have something similar, so for Access that would be:
SELECT top 1 * FROM mytable ORDER BY primary_key DESC
This only returns one record in the resultset.
--
Marja Ribbers-de Vroed
Internet:
- [url]www.webwaresystems.nl[/url]
- [url]www.clubwebware.nl[/url]
- [url]www.flevooware.nl/dreamweaver[/url]
"David Powers" <dp@example.com> wrote in message news:d5l4ln$4kc$1@forums.macromedia.com...> Murray *TMM* wrote:>>> How can I do that? I have a table with record that are updated periodically
>> through the day. I want a page that only loads the last record. How?
> SELECT * FROM mytable
> ORDER BY primary_key DESC
> LIMIT 1
>
> That's the MySQL way, the LIMIT clause may be different on other flavours.
>
> --
> David Powers
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> Co-author "PHP Web Development with DW MX 2004" (Apress)
> [url]http://computerbookshelf.com[/url]Marja Ribbers Guest
-
Murray *TMM* #11
Re: Loading a recordset at the last record?
Thanks, Marja!
--
Murray --- ICQ 71997575
Team Macromedia Volunteer for Dreamweaver
(If you *MUST* email me, don't LAUGH when you do so!)
==================
[url]http://www.dreamweavermx-templates.com[/url] - Template Triage!
[url]http://www.projectseven.com/go[/url] - DW FAQs, Tutorials & Resources
[url]http://www.dwfaq.com[/url] - DW FAQs, Tutorials & Resources
[url]http://www.macromedia.com/support/search/[/url] - Macromedia (MM) Technotes
==================
"Marja Ribbers" <marja@nospam.webwaresystems.nl> wrote in message
news:d5ncqh$gr$1@forums.macromedia.com...
Access does not support 'limit 1' but does have something similar, so for
Access that would be:
SELECT top 1 * FROM mytable ORDER BY primary_key DESC
This only returns one record in the resultset.
--
Marja Ribbers-de Vroed
Internet:
- [url]www.webwaresystems.nl[/url]
- [url]www.clubwebware.nl[/url]
- [url]www.flevooware.nl/dreamweaver[/url]
"David Powers" <dp@example.com> wrote in message
news:d5l4ln$4kc$1@forums.macromedia.com...> Murray *TMM* wrote:>>> How can I do that? I have a table with record that are updated
>> periodically
>> through the day. I want a page that only loads the last record. How?
> SELECT * FROM mytable
> ORDER BY primary_key DESC
> LIMIT 1
>
> That's the MySQL way, the LIMIT clause may be different on other flavours.
>
> --
> David Powers
> Author, "Foundation PHP 5 for Flash" (friends of ED)
> Co-author "PHP Web Development with DW MX 2004" (Apress)
> [url]http://computerbookshelf.com[/url]
Murray *TMM* Guest



Reply With Quote

