Error

Started by Cool, Feb 15, 2016, 02:46 PM

Previous topic - Next topic

Cool

in screenshot error is defined
function Loan( player )
{
      local query = QuerySQL( sqliteDB, "SELECT * FROM Loan WHERE Loan_nick='" + player.Name + "' COLLATE NOCASE" );
   if( GetSQLColumnData( query, 0 )  )
   {
         if( ( time() - GetSQLColumnData( query, 3 ).tointeger() )
   {
       local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick" + player.Name + "'" );
    FreeSQLQuery( query2 );
       MessagePlayer(" you loan time finished.", player );
   }
}
   else MessagePlayer("ALERT: YOU DIDNOT PAYED LOAN" ,player);
}







.

Awwww, my eyes. MY EYES. What DAFUQ did I just read! Holy f* the messed up structuring on that code AND the number of missing closing braces. MY EEEEEYYYYYEEEEESSS!
.

Cool

Quote from: S.L.C on Feb 15, 2016, 03:03 PMAwwww, my eyes. MY EYES. What DAFUQ did I just read! Holy f* the messed up structuring on that code AND the number of missing closing braces. MY EEEEEYYYYYEEEEESSS!
i added already while testing but same result dear @S.L.C

Luckshya

#3
Try changing this line
local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick" + player.Name + "'" );
To
local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick='" + player.Name + "'" );

Cool


Luckshya

Quote from: Hercules on Feb 15, 2016, 03:11 PMnot working
Ok, i forgot one sign, try it again.

.

Quote from: Luckshya on Feb 15, 2016, 03:07 PMTry changing this line
local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick" + player.Name + "'" );
To
local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick='" + player.Name + "'" );


USELESS!

Quote from: S.L.C on Feb 15, 2016, 03:03 PM... AND the number of missing closing braces.
.

Cool


.

Oh FFS do I have to spell it out loud:

function Loan( player )
{
    local query = QuerySQL( sqliteDB, "SELECT * FROM Loan WHERE Loan_nick='" + player.Name.tolower() + "';" );

    if ( !query )
    {
        return;
    }
    else if( GetSQLColumnData( query, 0 )  )
    {
        if( ( time() - GetSQLColumnData( query, 3 ).tointeger() )
        {
            local query2 = QuerySQL( sqliteDB, "DELETE FROM Loan WHERE Loan_nick='" + player.Name + "';" );
            FreeSQLQuery( query2 );
            MessagePlayer(" you loan time finished.", player );
        }
    }
    else
    {
        MessagePlayer("ALERT: YOU DIDNOT PAYED LOAN" ,player);
    }

    FreeSQLQuery( query );
}
.

KAKAN

I already answered it to him in PM, he just can't understand
oh no

Cool

@KAKAN I FORGET I WANT TO SHARE ABOUT YOUR HELP IN PM BUT SAME ERROR AND SLC ONE HAVE SAME ERROR ITS MEAN PROB IN MY DB
MY CAPLOCKS BUTTON NOT WORKING :D

KAKAN

Quote from: Hercules on Feb 15, 2016, 03:52 PM@KAKAN I FORGET I WANT TO SHARE ABOUT YOUR HELP IN PM BUT SAME ERROR AND SLC ONE HAVE SAME ERROR ITS MEAN PROB IN MY DB
I said your DB has problems. Show us your table create code and one row from it.
oh no

Cool

  QuerySQL( sqliteDB , "CREATE TABLE IF NOT EXISTS Loan( Loan_nick TEXT, Loan_amount TEXT, Loan_time TEXT )" );

KAKAN

Quote from: Hercules on Feb 15, 2016, 03:56 PM  QuerySQL( sqliteDB , "CREATE TABLE IF NOT EXISTS Loan( Loan_nick TEXT, Loan_amount TEXT, Loan_time TEXT )" );
What about a row? Show me Loan_time, I wanna see if you increase the loan time using time or not.
oh no