SA-MP Forums Archive
Sscanf In SQLite - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sscanf In SQLite (/showthread.php?tid=408995)



Sscanf In SQLite - Brokenbreaken - 20.01.2013

I can use sscanf in SQLite?

Код:
public OnGameModeInit()
{
	Database = db_open("Server.db");
	DatabaseResult = db_query(Database,"CREATE TABLE IF NOT EXISTS `Private Vehicles` (`Id` INT(5),`Price` INT(10),`Owner` CHAR(25),`Interior` INT(5),`PositionX` FLOAT(10,5),`PositionY` FLOAT(10,5),`PositionZ` FLOAT(10,5),`PositionA` FLOAT(10,5))");
	db_free_result(DatabaseResult);
	for(new PV = 0; PV < MAXIMAL_PRIVATE_VEHICLES; PV++)
	{
		format(Query,500,"SELECT * FROM `Private Vehicles` WHERE `Id` = '%d'",PV);
		DatabaseResult = db_query(Database,Query);
		if(db_num_rows(DatabaseResult))
		{
		
		}
		if(!db_num_rows(DatabaseResult)) continue;
	}
	return 1;
}
Instead db_get_field_assoc?


Re: Sscanf In SQLite - Scenario - 20.01.2013

I don't believe you can use sscanf to retrieve values from SQLite. You have to do them one by one.