SA-MP Forums Archive
Sqlite help - 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: Sqlite help (/showthread.php?tid=431467)



Sqlite help - Ryan_Obeles - 18.04.2013

ok so i was making a rp server with sqlite and i have no idea if or how you could do this


db_free_result(db_query(PGRP, "CREATE TABLE IF NOT EXISTS `Accounts` (`Vip`, `Money`, `Level`,`Age`,`Admin`,`Gender`,`Accent`,`CarLic`,` BoatLic`,`FlyLic`,`PosX`,`PosY`,`PosZ`,`PosAngle`, `Payday`,`Hadpayday`,`Family`,`Faction`,`Tutorial` ,`FacRank`,`Skin`,`Health`,`Armour`,`Interior`,`VW `,`Injured`,`Job`,`BankMoney`,`Weap1`,`Weap1Ammo`, `Weap2`,`Weap2Ammo`,`Weap3`,`Weap3Ammo`,`Weap4`,`W eap4Ammo`,`Weap5`,`Weap5Ammo`,`Weap6`,`Weap6Ammo`, `Weap7`,`Weap7Ammo`,`Weap8`,`Weap8Ammo`,`Weap9`,`W eap9Ammo`,`Weap10`,`Weap10Ammo`,`Weap11`,`Weap11Am mo`,`Weap12`,`Weap12Ammo`,`PRadio`,`PRadioFreq`)") );

it gives me error that its too long ( simplified ) HELP PLS


Re: Sqlite help - Vince - 18.04.2013

Create tables manually. You only have to create a table once. Running this query at each startup is useless. There are many free SQLite browsers that you can use.


Re: Sqlite help - Jay_ - 18.04.2013

Quote:
Originally Posted by Vince
Посмотреть сообщение
Create tables manually. You only have to create a table once. Running this query at each startup is useless. There are many free SQLite browsers that you can use.
I disagree. That's like saying that if the server has any text files that it needs to dump data to, the owner should create them manually. There's no need to run the query every time upon initialisation, no, you can however use the fexists native to see if the database is in place and only perform the query under that circumstance. It's also more useful for referencing purposes within the code.

Quote:

ok so i was making a rp server with sqlite and i have no idea if or how you could do this


db_free_result(db_query(PGRP, "CREATE TABLE IF NOT EXISTS `Accounts` (`Vip`, `Money`, `Level`,`Age`,`Admin`,`Gender`,`Accent`,`CarLic`,` BoatLic`,`FlyLic`,`PosX`,`PosY`,`PosZ`,`PosAngle`, `Payday`,`Hadpayday`,`Family`,`Faction`,`Tutorial` ,`FacRank`,`Skin`,`Health`,`Armour`,`Interior`,`VW `,`Injured`,`Job`,`BankMoney`,`Weap1`,`Weap1Ammo`, `Weap2`,`Weap2Ammo`,`Weap3`,`Weap3Ammo`,`Weap4`,`W eap4Ammo`,`Weap5`,`Weap5Ammo`,`Weap6`,`Weap6Ammo`, `Weap7`,`Weap7Ammo`,`Weap8`,`Weap8Ammo`,`Weap9`,`W eap9Ammo`,`Weap10`,`Weap10Ammo`,`Weap11`,`Weap11Am mo`,`Weap12`,`Weap12Ammo`,`PRadio`,`PRadioFreq`)") );

it gives me error that its too long ( simplified ) HELP PLS

You need to provide more information, such as the exact error. What's too long? I also don't know why you're calling db_query within db_free_result yet it's not retrieving any results. You may find it more logical to look up particular SQLite errors on the official website or using a search engine.


Re: Sqlite help - romas3110 - 18.04.2013

pawn Код:
db_query(PGRP, "CREATE TABLE IF NOT EXISTS `Accounts` (`Vip`, `Money`, `Level`,`Age`,`Admin`,`Gender`,`Accent`,`CarLic`,` BoatLic`,`FlyLic`,`PosX`,`PosY`,`PosZ`,`PosAngle`, `Payday`,`Hadpayday`,`Family`,`Faction`,`Tutorial` ,`FacRank`,`Skin`,`Health`,`Armour`,`Interior`,`VW `,`Injured`,`Job`,`BankMoney`,`Weap1`,`Weap1Ammo`, `Weap2`,`Weap2Ammo`,`Weap3`,`Weap3Ammo`,`Weap4`,`Weap4Ammo`,`Weap5`,`Weap5Ammo`,`Weap6`,`Weap6Ammo`, `Weap7`,`Weap7Ammo`,`Weap8`,`Weap8Ammo`,`Weap9`,`W eap9Ammo`,`Weap10`,`Weap10Ammo`,`Weap11`,`Weap11Am mo`,`Weap12`,`Weap12Ammo`,`PRadio`,`PRadioFreq`)");
Try that.


Re: Sqlite help - Ryan_Obeles - 19.04.2013

I made backup of my server so there is a *copy*

C:\Users\aa\Desktop\Server\gamemodes\PGRP\PGRP - Copy.pwn(283) : error 075: input line too long (after substitutions)
C:\Users\aa\Desktop\Server\gamemodes\PGRP\PGRP - Copy.pwn(284) : error 037: invalid string (possibly non-terminated string)
C:\Users\aa\Desktop\Server\gamemodes\PGRP\PGRP - Copy.pwn(284) : error 017: undefined symbol "CREATE"
C:\Users\aa\Desktop\Server\gamemodes\PGRP\PGRP - Copy.pwn(284) : error 017: undefined symbol "TABLE"
C:\Users\aa\Desktop\Server\gamemodes\PGRP\PGRP - Copy.pwn(284) : fatal error 107: too many error messages on one line