sql error in php.....

Results 1 to 5 of 5
  1. #1
    Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    97Posts

    sql error in php.....

    hey guys i want to create a simple query to find only a few rows from an sql table and view it on my website.. i want to use limit but it doesnt work... this is the sql:
    PHP Code:
    odbc_exec($GLOBALS['dbconn'], "SELECT dwCharID, dwTotalPoint FROM TGAME_GSP.dbo.TPVPOINTTABLE ORDER BY dwTotalPoint DESC LIMIT 1"); 
    the error:

    if i delete "LIMIT 1" everything works...


  2. #2
    The Omega Superfun is offline
    The OmegaRank
    Dec 2006 Join Date
    6,348Posts

    Re: sql error in php.....

    Assuming you're using Microsoft SQL, "LIMIT" does not exists within MSSQL.


  3. #3
    Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    97Posts

    Re: sql error in php.....

    yea its microsoft sql server... and is there anything similar to limit ??

  4. #4
    Deep thoughts sql error in php..... Joopie is offline
    Alpha MaleRank
    Jun 2010 Join Date
    The NetherlandsLocation
    2,661Posts

    Re: sql error in php.....

    You can use TOP 1. For example SELECT TOP 1 dwCharID ......

    See this website for more information: https://docs.microsoft.com/en-us/sql...ql-server-2017

  5. #5
    Member tairasan is offline
    MemberRank
    Mar 2018 Join Date
    97Posts

    Re: sql error in php.....

    thanks.



Advertisement