SQLite Question
#1

Has anyone created a function similar to mysqls mysql_insert_id(); function for SQLite usage?

Because right now what I can do is limited because I need it to return the ID of the auto-increment named id.

I would assume that the easiest way would be to loop through all id's and find the highest, but then again if by some chance another query was executed before the loop had finished then it would return an ID of another item, or is there another way to do it?

Pretty confused about this because I'm not that used to mysql never mind sqlite although I've had no problems as of yet.

Any ideas?
Reply
#2

SQLite is a program right ? try use Navicat
Reply
#3

What has this got to do with anything?
Reply
#4

Offtopic didn't you leave samp?

Well, you should you use mysql, its quite easier, I am sorry I can't help you any further because I honestly never touched SQLite.
Reply
#5

Try MAX(field_name) in your query


Quote:
Originally Posted by playbox12
Посмотреть сообщение
Offtopic didn't you leave samp?

Well, you should you use mysql, its quite easier, I am sorry I can't help you any further because I honestly never touched SQLite.
Then don't bother posting, and you clearly have no clue about the differences.

Quote:
Originally Posted by gigi1223
Посмотреть сообщение
SQLite is a program right ? try use Navicat
SQLite is an open source SQL database system built into the SA:MP server. No additional plugins are required to use SQLite. This feature of SA:MP was introduced in version 0.2.2.

The database files of SQLite files are commonly stored in .db files and are accessed in the servers \scriptfiles\ directory.
Reply
#6

Solved, had to create a custom function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)