Display the last 10 entries in database...

Hi, I would like to display the last 10 entries in my database, I use PHP and mySQL and Dreamweaver...

the latest entries are defined by the 10 highest ID numbers in the database, but there may be gaps in the numbers if an entry has been deleted.

What the WHERE the statement would look like to my request

SELECT *.
OF databasetable
WHERE ID = the largest number less than 10?
ORDER BY ID ASC

Any ideas greatly appreciated!

Best regards, Ken

The correct way to proceed in MySQL is like this:

SELECT *
FROM databasetable
ORDER BY ID DESC
LIMIT 10

It retrieves the results in reverse order.

If you want to order the results in ascending order AND use MySQL 4.1 or higher, you can do this:

SELECT * from databasetable
WHERE ID > (SELECT ID FROM databasetable ORDER BY ID DESC LIMIT 10, 1)
ORDER BY ID ASC

Tags: Dreamweaver

Similar Questions

  • display the last value

    Hi all

    I have a questions. It is that I create a Subvi to my table and it can display the last value in the upper part. Below attached snapshots of my programming. I use a number random and STOP for control of you guys let see the whole process of what I want.

    but when I change "constant true/false" and using a digital command. and I put it in my program. It won't list down the values and it will not display the most recent value at the top. What is the problem? I was stuck on this problem for a while.

    and another question was how to keep the size of the list is constant? for example, I onli wants to view 30readings on my table. as the program continued to run, the oldest value will be overwritten. because if kept under my table more, means memory increase my programming and registration of cause late development. I do not want to happen. So is it possible to maintain the display of fixed table values?

    Hi Isabelle,.

    I think that the problem causes initialization of a register shift to void / vi. If you initialize a shift register, each time sub vi is called, he will replace value in the registry to offset with initialized value. Uninitialize a registry change to resolve a problem. I've attached a screenshot of my sub vi for your reference.

    Sincerely, Kate

  • last name in my contact list is not displayed. It's as if the list is long and will not display the last of them.

    Last name in my contact list is not displayed. It's as if the list is long and will not display the last of them. Is there anyway to fix this?

    Hello

    1. are you referring to e-mail contacts or Windows contacts?
    2. who is your provider of mail service?
    3. using any e-mail client?
    4. don't you make changes to the computer before the show?

    Suggestions for a question on the help forums
    http://support.Microsoft.com/kb/555375

    The information is not sufficient to answer your question. Please provide us with more information to answer your question better.

  • Web Apps - I would like to display the last 3 items in a classification

    Web Apps - I would like to display the last 3 items in a classification using named parameters. This link does not help enough that I can't with any instructions. - http://docs.businesscatalyst.com/dev-assets/reference#! / module-reference/web-apps/module_w ebapps.html

    You wonder if it is what can be solved using liquid.

    In the loop in the collection limit: 3

  • Hi, back back can check files you opened with "recent files"? With my current setup, I can only see the last 10 files. Can I change the setting to display the last 20 files for example? Thank you

    Hi, back back can check files you opened with "recent files"? With my current setup, I can only see the last 10 files. Can I change the setting to display the last 20 files for example? Thank you

    File management preferences is where you can change the number. I don't know the maximum.

  • How to scrolledPane/text box to display the last lines?

    I have a JTextArea in a get.

    I add to the text box and scrolls information off the visible portion of the screen.
    How can I force the scrollbar to always display the last few lines at the bottom of the screen when they are added?

    Thank you.

    See [url http://www.camick.com/java/blog.html?name=text-area-scrolling] text scroll area

  • Utlity 3 & DPP4 displays the last captured image

    Using utility 3 and dpp4 attached, I can't do the last image automatically appears in the window.  The thumbnail is displayed, but that's all.  Can someone tell me the setting I have to change?

    for those looking for this:

    in dpp4,.

    Click on "remote shooting.

    Choose the folder and 'ok '.

    lower left corner of the window there are 3 little icons of the window, choose the middle one.

    lower left corner of the inner window theres a-/ + cursor.  to drag all the way to -.

    back at the bottom left of the window 3 icons of the small window, choose the one on the right

    reduce the 'file' and 'camera' on each side panel by clicking on the small arrows in the middle of each side

    (they pop open when you hover over them)

    fact.

    > Thanks to the very helpful and friendly technical support at Canon

  • How can I display the last field added to the Manager (bottom) and keep the scrolling feature?

    Issues around scrolling on managers of blackberry is a real headache.

    I would like to be able to add fields to the bottom of a Manager and have this field displayed on the merits without taking the focus to another control.

    I'm looking for something similar to how works the yahoo chat window, for example.

    I was not able to get the last label field added to the box to display.

    Here is the code relavent I have:

    
     //adds a labelfield and a nullfield to the display    public void update()  {     UiApplication.getUiApplication().invokeLater( new Runnable()        {            public void run()            {             try               {                 scrollingWindow.add(new LabelField("Hello1" + count) );                   //add nullfield to facilitate scrolling                   NullField nullField = new NullField( NullField.FOCUSABLE );                   scrollingWindow.add(nullField);                   count++;              }             catch( Exception ex )             {                 Dialog.alert( ex.getMessage() );              }            }        }); }
    

    Any ideas?

    Couple of quick things:

    (1) you can make your LabelField focusable and save adding the NullFields

    New LabelField ("Hello1" + count, Field.FOCUSABLE)

    (2) have you tried to discover what field has focus, then set the focus on your new field, and then reset back to that he originated from?

  • 4.1 Developer, the output of the Script window does not display the last line of the output automatically

    Hi all

    I use the new version of the developer 4.0.1.14 on Windows 7 x 64, I noticed that the result of the query or the output of the script does not display as before:

    When I run a query lets say with 100 lines of output, run the query successfully, but the cursor jumps automatically to the last record in the game as in all previous versions, I have to scroll manually everytime.

    Can I change this?

    Thank you

    No, unfortunately, it's a bug.

    It is not for all queries however. Still boring.

  • OCD books display the last topic in the previous book when you click

    I found a weird behavior when looking at the release published on HR Server 8 from a client RH8 and using a merged help file configuration (implementing merged maybe project although not relevant). By clicking on any book TOC displayed in the topic pane the last topic in the book of immediatey above him. In the example below, the table of contents is on the 'Basics' book and the displayed topic is "Tab management" which lies immediately above the book. Any book is clicked, the same behavior follows.

    rhserser_toc.png

    This problem is limited to when help is displayed via the HR eithere server by clicking on the button 'View Project' with the Web administrator or displayed through the application. Bizzarely, it does not occur if you manually open the start page in a web browser from the HR server. Or the problem itself using the WebHelp output manifest.

    Someone has seen this. I tried to report it as a bug but thought that I have would float it out there first.

    Hi - I believe that the problem has already been postponed.

    See http://forums.adobe.com/click.jspa?searchID=1351909&objectType=2&objectID=2026022

  • How to display the "last process/Update Date' on the dashboard home screen / Hyp IR

    Hyperion IR V9.3

    I want a simple date field on my Hyperion, dashboard home screen that informs users of the last execution of the query option all processes and data has been updated.  How can I do this?

    If the solutions provided please mark the closed question and acknowledge the contributors properly.  If the solutions do not meet your question please let us know where you need clarity.

    w

  • display the last 25 values in lov

    Hi How can I don't post that the last 25 values in my lov am in jdeveloper 11.1.1.6.0
    My iterator is
    <iterator Binds="CountryLOV1" RangeSize="-1"
                  DataControl="UAMAppModuleDataControl1" id="CountryLOV1Iterator"/>

    I guess you must write the request in a way that it returns the line that you want to see (the last n in your case).

    Timo

  • Display the last few lines added

    Hello

    Could someone help me how to prepare a select statement which show the last 10 added lines? I have the column with DATE format.

    Best.

    Hi Best

    SQL > drop table t;

    Deleted table.

    SQL > create table t (t1 date);

    Table created.

    SQL > insert into values (sysdate) t;

    1 line of creation.

    SQL > insert into t values (sysdate + 1);

    1 line of creation.

    SQL > insert into t values (sysdate + 2);

    1 line of creation.

    SQL > insert into t values (sysdate + 3);

    1 line of creation.

    SQL > insert into t values (sysdate + 4);

    1 line of creation.

    SQL > insert into t values (sysdate + 5);

    1 line of creation.

    SQL > insert into t values (sysdate + 7);

    1 line of creation.

    SQL > insert into t values (sysdate + 6);

    1 line of creation.

    SQL > insert into t values (sysdate + 8);

    1 line of creation.

    SQL > insert into t values (sysdate + 9);

    1 line of creation.

    SQL > insert into t values (sysdate + 10);

    1 line of creation.

    SQL > insert into t values (sysdate + 11);

    1 line of creation.

    SQL > insert into t values (sysdate + 12);

    1 line of creation.

    SQL > commit;

    SQL > select * from (select * from (select rownum, t1 from t by t1 desc) where rownum)<=10) order="" by="" t1="">

    ROWNUM T1
    ------ ---------
    6 24 AUGUST 09
    8 25 AUGUST 09
    7 AUGUST 26 09
    9 27 AUGUST 09
    10 28 AUGUST 09
    11 AUGUST 29, 09
    12 30 AUGUST 09
    13 31 AUGUST 09
    14-01 - SEP - 09
    15-02 - SEP - 09

    Please use above written request...

    A P R I T S I N H A

  • Have several saved tabs to reopen on FF6.0 start, but once they charge, it displays the last open tab. If I try to click on another tab I opened, change the url in the address bar, but it still shows the last tab open on the screen.

    This happens if I click on one of the tabs I opened.

    That's why Firefox is useless because I can't show a tab at a time and would have to open it again if I want to display again.

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

    It is also possible that there is a problem with the sessionstore.js and sessionstore.bak files in the Firefox profile folder.

    Delete the sessionstore.js file [2] and sessionstore.bak in the Firefox profile folder.

    If you see files sessionstore-# .js with a number in the left part of the name as sessionstore - 1.js then delete those as well.

    Delete sessionstore.js will cause App Tabs and tab groups and opened and closed the tabs (back) to get lost, so you will need to create them again (take note or bookmarks).

    See also:

  • Add an Extension field to save the last Action of the agent and display this on email

    I am trying to add an extension field to a call to save the last Action Officer tapped on a call.  I do what we want to display (on e-mail alerts, for example) the last 'real' action taken a call, and we don't want to display the text of the generated system which is often recorded in the SOLUTION_DESC column.
    for example, e-mail sent displays like this:
    snip2.png
    I created the extension field and have obtained this update when the call is handled (details of the changes I made are below).


    The problem I have is that the email that is sent to the receiving a transferred call is the latest version of the data from the field to this topic.  It's as if the system did not write data in the database until the logic 'send e-mail' runs.  If I have question registration in SQL immediately after the postponement or the transfer of the call I can see the update is written to the field of the extension of the database, but there after send it an email.

    for example, I change a call and type something in the field of Actions and Solutions.  I transfer the call to a group.  The email that is sent to the groups has the extension defined field to display on this, but it does not display the last typed Action in, it displays the previous Action (there's a).

    Any suggestions on how to make sure that e-mail displays the last Action?

    The changes I've done so far:
    In Custom_InCallDetails.js
    Added the custom function:
    function setLastUserActionText() {}
    var da = document.all;
    var sd = da. SOLUTION_DESC_HTML_EDITOR. Area;
    If ((da. TEMPLATE_IND. Value! = 1) & & (sd! = ") & &! (TF (da. TakeOver.value)))
    {
    var DB = FindNavWindow (). document.all.DB;
    var localRS;
    var OfficerName;
    var CurrentDate = new Date();
    DB. ClearParam();
    DB. AddParam ("REF", da.) OFFICER_REF.value);
    localRS = DB. GetRecordSet ("Get agent Name");
    If (localRS == null | localRS.recordCount == 0)
    OfficerName = '(unknown) ';
    on the other
    OfficerName = (localRS("FULL_NAME").value);
    DB. ClearParam();
    DB. AddParam ("CALL_NUMBER", da.) CALL_NUMBER.value);
    DB. AddParam ("SOLUTION_DESC", (sd + "\r\n (in" + OfficerName + "on" + CurrentDate.toLocaleString () + "" ")" ""));
    localRS = DB. GetRecordSet ("CustomGetLastUserActionText");
    If (localRS == null | localRS.recordCount == 0)
    {
    localRS = DB. GetRecordSet ("CustomAddLastUserActionText");
    localRS = DB. GetRecordSet ("CustomUpdateExtensionDataAllocation");
    }
    on the other
    localRS = DB. GetRecordSet ("CustomSetLastUserActionText");
    }
    }

    Update OnSubmit function call:
    function OnSubmit (s)
    {

    p.Submitted = false;
    Returns false;
    }
    Start personalization
    setLastUserActionText();
    Customization of the end

    SetSubmitValues();

    }

    In infra_custom.sql
    ! CustomUpdateExtensionDataAllocation
    CustomUpdateExtensionDataAllocation
    UPDATE SU_NUMBER_ALLOC SET NUMBER_ALLOC = (SELECT MAX (REF) + 1 SU_EXTENSION_DATA) WHERE TABLE_ALLOC = 'SU_EXTENSION_DATA. '

    ! CustomGetLastUserActionText
    ! 500219 is the Ref of the field "last user action text.
    CustomGetLastUserActionText
    SELECT REF FROM SU_EXTENSION_DATA WHERE REF_NO =: nCALL_NUMBER AND EXTENSION_FIELD_REF = 500219

    ! CustomAddLastUserActionText
    CustomAddLastUserActionText
    INSERT INTO SU_EXTENSION_DATA
    (REF,
    REF_NO,
    EXTENSION_FIELD_REF,
    VALUE_STRING,
    CORE_ENTITY)
    SELECT
    (SELECT MAX (REF) + 1 OF SU_EXTENSION_DATA) + ROW_NUMBER () OVER (ORDER BY: nCALL_NUMBER).
    : nCALL_NUMBER,.
    500219,
    : sSOLUTION_DESC,.
    1

    ! CustomSetLastUserActionText
    CustomSetLastUserActionText
    UPDATE SU_EXTENSION_DATA SET = VALUE_STRING: sSOLUTION_DESC WHERE REF_NO =: nCALL_NUMBER AND EXTENSION_FIELD_REF = 500219

    Why not add the extension field in the call screen. Then update the field on the screen in onsubmit. In this way, it will update the value and be available to the e-mail address.

Maybe you are looking for

  • Why my addons disappeared suddenly

    If, for some strange reason my addons disappeared. One day they were there and the next day they were gone. I don't know what is happening. I tried to look in several different folders and there is still no sign of one of my addons. So, where are the

  • visibility of photos

    can anyone help me on how I can see thumbnails of the pictures on my files or in my office... I'm tired to reopen all the thumbnails of the photos if I'm looking for something, please help me as soon as possible. Thank you

  • Windows Vista tells me that my product key is already used and he locked.

    Vista ultimate Windows... Hi, the product key has been used. Used by me! Hey, shot to the top of the laptop to see a dialog box indicating that the product key is used and it is locked. I use the key it's mine. What should I do?

  • code 80070103 Download Intel Grapics

    How can I make my windows 7 stop trying to install the Intel graphics card. I went to a show and downloaded a driver but didn't like it is so removed and ended up with the biggest mess I've ever had. Wiped out my internet server before all thanks to

  • Smartphones from blackBerry Desktop Manager and my Internet connection

    Hello.  I recently installed Dektop Manager 5.0 and met performance problems when my computer starts.  My Internet connection is displayed as it is disconnected for several minutes after the start of my Windows Vista Premium Home Edition SP2 system.