sqlite

Floats are not saved correctly into SQLite table using PHP

Hi, I'm using SQLite 3 with PHP. The SQLite table consists of 2 INTEGER and one FLOAT column. When saving data into this table using PHP floats are not saved correctly (default value is stored instead). The two integer columns are saved. Any ideas what could be wrong? Thank you. Simplified code that actually works correctly: $conn = n...

how do you deal with timezone issues?

Hello, For a scheduling system, what's the best way to save the timezone of client/event in a central server database coming from multiple sources mobile,web,client app. How do you store the dates? Alarms, reminders etc... How do you handle the DST setting? How do you handle the events if client has traveled to a different locat...

Is it possible to JOIN with a var from a LEFT JOIN without destrorying rows?

My code generates a large query. A simple version is SELECT * FROM main_table as mt JOIN user_data AS ud ON mt.user_id=ud.id LEFT JOIN ban_Status AS bs ON ud.status_id=bs.id JOIN AnotherTable ON bs.data=AnotherTable.id NOTE: This code is untested. When i remove the last join i get results. I can also change it to left join but that...

Why does SQLite not bring back any results from my database

This is my first SQLite based iPhone app and I am trying to get it to read a menu hierarchy from my database. The database appears to be registered fine as the compiled statement doesnt error (tried putting in valid table name to test) but for some reason sqlite3_step(compiledStmt) doesnt ever equal SQLITE_ROW as if to suggest there is ...

Verifying sqlite FTS (Full Text Search) syntax, and how to do a single term NOT search

Is there a way to determine if a MATCH query sent to an fts3 table in sqlite is valid? Currently, I don't find out if the expression is invalid until I try to run it, which makes it a little tricky. I'd like to report to the user that the syntax is invalid before even trying to run it. I'm using sqlite with the C api. Additionally, do...

Does SQLite have a machine portable file format that the C API can read/write?

I've tried passing binary SQLite DBs over the network between different OSes and architectures - it didn't work. What format are you all using? I've tried an unholy hack of copying SQLite's shell.c and calling shell_main() with a hacked up argc, argv, stdin with success on Mac. Pity I'm developing for the iPhone and it fails only there....

Core Data Query slow

What's the secret to pulling up items that match characters typed into the search bar that react instantaneously? For instance, if I type in a letter "W" in the search bar, all phrases that contain a letter "W" in any character position within the phrase are returned immediately. So if a database of 20,000 phrases contains 500 phrases w...

SQLite bulk insert on iPhone not working

Hi. I have been struggling with this seeminly easy problem for 48 hours, and I am no closer to a solution. So I was hoping that someone might be able to help me. I am building a app, that use a combination of a local (SQLite) database and an online database (PHP/MYSQL). The app is nearly finished. Checked for leaks and work like a char...

how to save time from compiling whole project ?

I am implementing some idea on sqlite3. Every time I want to test my codes, I have to compile the whole project. The following is exactly what I do : sudo make uninstall sudo make clean ./configure sudo make sudo make install some of above commands cost long time. What should I do to save time? ...

Interdependent Callbacks in webOS Programming

This is a conceptual question. Many of the operations that happen in webOS are asynchronous. I have done Ajax programming before, but it feels like webOS takes it to a new level. Take the following example of an application that retrieves a list of news articles from the web, and also caches articles locally in an HTML5 storage database...

Is there anything wrong with this ORM?

Roughly a month ago (after christmas) i found this post and realized how useful reflection is. So i decided to learn and got carried away and spent around 10days on this which became a ORM for sql(ite). My question is, is there anything wrong with this ORM is used? I never used an ORM before and i heard you should not write one yourself...

How automate sqlite db creation in Xcode and put it in the app bundle

I have a sqlite DB that has a lot of test data inside. Currently, I load the data inside the app code, but take several minutes inside the iPod I use for testing. I wonder if is possible to make in Xcode a pre-build tests that inits the db, then adds it to the app bundle, so I can extract it from the iPod. I'm stuck in how create & pre...

SQLite Equivilant of PostgreSQL GREATEST() Function

Postgres has a useful function called GREATEST (which returns the largest value of those passed to it, documented here: http://www.postgresql.org/docs/8.4/interactive/functions-conditional.html), is there any equivalent in SQLite? As a note, I only need it to work with 2 arguments. ...

How do I group by min value in one field of table, keeping all the values from that same row?

I have a table like this: Field1 | Field2 | Field3 1 | 1 | 22 1 | 2 | 10 2 | 5 | 40 2 | 2 | 55 I want to group by Field1, and then take the values from the rest of the row with the minimal Field2, eg: Field1 | Field2 | Field3 1 | 1 | 22 2 | 2 | 55 Note that this is not the...

Is there a way i can do multiple inserts into one table using a condition?

Is there a way i can do multiple inserts into one table using a condition? i have a list of subscribers in tbl_subscribers. i have an update on productX so i would like everyone who is subscribes to productX to get a notification. The user_notification table is id PK, user_id, notification_id. The two values i need is product_id (produc...

SQLLite Code works on iPhone simulator, crashes on iPad

This code works fine on the iPhone and the iPhone simulator, but crashes the simulator when running on the iPad: const char *createsql = [MYClass GetDBCreationString]; sqlite3_stmt *crts; if (sqlite3_prepare_v2(database, createsql, -1, &crts, NULL) == SQLITE_OK) { int success = sqlite3_step(crts); if (success != SQLITE_DONE) { ...

Subsonic 3 + SQLite 3

I am trying to use Subsonic for SQLite. I got an exception "SQLite error near ".": syntax error". VS 2008; Subsonic 3.0.0.3; SQLite 3. How I can to resolve it? Also, cananybody provide an project example with Subsonic for SQLite included. ...

Code generator for SQLite and .Net

What code generator tool you are using for SQLite and .Net ? ...

.NET / SQLite. Inserting parent/child record; how do I get the foreign key?

I use VS 2008 (C#) and SQLite via ADO.NET 2.0 Provider (SourceForce project). The database used by application contains an "employees" (parent) and "employmentHistory" (children) datatables. "eploymentHistory" datatables is supposed to contain all the working contracts for any given employee from day 1 (e.g. a promotion will generate a ...

Backup and restore sqllite database to sdcard

How can I backup my database to the sdcard automatically in my app? And afterward, how do I restore it? ...