SQLite - Insert INTO ... not working
#4

Quote:
Originally Posted by SKAzini
View Post
Do you use PHPMyAdmin? If so, try to run the SQL code in the SQL tab thingy to see if the queries work.
no, SQLite doesn't have PHPMyAdmin.. afaik..
I just use the default SQLite Browser :d

Quote:
Originally Posted by SturtIndia
View Post
Well, its hard for some people to understand. I think you have to see in this:
pawn Code:
stock CreateFaction(ownerid, name[])
{
    new DBResult:result, Query[360];
    new DBResult:count = db_query(Factions, "SELECT * FROM `FACTIONS`");
    if(db_num_rows(count)) format(Query, sizeof(Query), "INSERT INTO `FACTIONS` (`ID`, `NAME`, `LOCKED`, `ACTIVE`, `MAXMEMBERS`, `MEMBERS`, `LEADER`, `HASLEADER`, `RANK1`, `RANK2`, `RANK3`, `RANK4`, `RANK5`) VALUES ('%d', '%s', '1', '1', '10', '1', '%s', '1', 'Trial Member', 'Member', 'Senior Member', 'Assistant', 'Leader')", db_num_rows(count)+1, DB_Escape(name), DB_Escape(GetName(ownerid)));
    else if(!db_num_rows(count)) format(Query, sizeof(Query), "INSERT INTO `FACTIONS` (`ID`, `NAME`, `LOCKED`, `ACTIVE`, `MAXMEMBERS`, `MEMBERS`, `LEADER`, `HASLEADER`, `RANK1`, `RANK2`, `RANK3`, `RANK4`, `RANK5`) VALUES ('1', '%s', '1', '1', '10', '1', '%s', '1', 'Trial Member', 'Member', 'Senior Member', 'Assistant', 'Leader')", DB_Escape(name), DB_Escape(GetName(ownerid)));
    result = db_query(Factions, Query);
    if(result) SendClientMessage(ownerid, -1, "{64CC66}Faction successfully created!"), SendClientMessage(ownerid, -1, "{64CC66}You can use '/settings' to edit the faction info!");
    else SendClientMessage(ownerid, -1, "{FC4949}Failed to create faction, contact server owner(s).");
    db_free_result(result);
}
Eh? I don't see any changes there :l
Reply


Messages In This Thread
SQLite - Insert INTO ... not working - by Kyance - 17.09.2014, 15:41
Re: SQLite - Insert INTO ... not working - by SKAzini - 17.09.2014, 16:02
Re: SQLite - Insert INTO ... not working - by KayJ - 17.09.2014, 16:03
Re: SQLite - Insert INTO ... not working - by Kyance - 17.09.2014, 16:21
Re: SQLite - Insert INTO ... not working - by Pottus - 17.09.2014, 16:25
Re: SQLite - Insert INTO ... not working - by Kyance - 17.09.2014, 16:31
Re: SQLite - Insert INTO ... not working - by Jefff - 17.09.2014, 16:33
Re: SQLite - Insert INTO ... not working - by Kyance - 17.09.2014, 16:37
Re: SQLite - Insert INTO ... not working - by Jefff - 17.09.2014, 16:37
Re: SQLite - Insert INTO ... not working - by Kyance - 17.09.2014, 16:39

Forum Jump:


Users browsing this thread: 1 Guest(s)