Help on SQLite...
#1

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..
Reply
#2

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.
Reply
#3

Use MySQL, MySQLi sucks.
Reply
#4

SQLite isn't MySQLi...

Do your research before you post.

http://en.wikipedia.org/wiki/SQLite
http://en.wikipedia.org/wiki/MySQLi
Reply
#5

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

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.
Reply
#7

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)