SA-MP Forums Archive
Help on 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help on SQLite... (/showthread.php?tid=252454)



Help on SQLite... - paulj - 01.05.2011

Is there any way i can be sure a query executed successfully in SQLite... ?


For eg..

DBResult:db_query("UPDATE userdata SET pass='xxx' WHERE name='yyy';");


if i exec the above function.. 1 row gets updated in DB.. but how can i be sure of that ?

Is there any error finding methods in the In-Built SQLite ?


Please give some useful help and tips..


Re: Help on SQLite... - Calgon - 01.05.2011

The function db_query returns the result of the query, so I imagine it should return 0 if it fails, or something similar. Try execute a query that won't work and one that will work but wrap printf() around it to see what returns.


Re: Help on SQLite... - Ubuntu - 01.05.2011

Use MySQL, MySQLi sucks.


Re: Help on SQLite... - Calgon - 01.05.2011

SQLite isn't MySQLi...

Do your research before you post.

http://en.wikipedia.org/wiki/SQLite
http://en.wikipedia.org/wiki/MySQLi


Re: Help on SQLite... - Joe Staff - 01.05.2011

Plus SQLite is faster and doesn't need a third party server like MySQL does


Re: Help on SQLite... - Ubuntu - 01.05.2011

Quote:
Originally Posted by Calg00ne
Посмотреть сообщение
SQLite isn't MySQLi...

Do your research before you post.

http://en.wikipedia.org/wiki/SQLite
http://en.wikipedia.org/wiki/MySQLi
My fault.


Re: Help on SQLite... - paulj - 01.05.2011

Hi Calg00ne.. it doesnt return any proper values.. but i found a work around.. il give a hint..

Before we do any update statements.. (update , delete , insert ) we get the row count of the table..

And after the operation we get the row count again.. if both the row counts differ as we wish then we can find out the desired operation is done successfully or not.. pretty cool eh