On 31 Jan 2011, at 11:30am, Gabe da Silveira wrote: > I have a PHP script > that builds an sqlite3 client database for a ps3 application. > Depending on where I run the build the script (Gentoo or Mac OS X) I > get a database file that has different semantics for a column declared > as an integer pk: > > CREATE VIRTUAL TABLE Directors USING fts3(id INTEGER PRIMARY KEY NOT > NULL, first_name TEXT NOT NULL, last_name TEXT NOT NULL, > show_last_name_first INTEGER DEFAULT 0, normalised_name TEXT NOT NULL, > sort_name TEXT NOT NULL, fanships_count INTEGER, image_url > VARCHAR(255)); > > For the database file build on OS X or Windows I need to run: > > SELECT * FROM Directors WHERE id=1 > > For the database file built on Gentoo I need to run: > > SELECT * FROM Directors WHERE id='1' > > Otherwise I get no results.
Very strange. Naturally, the form where you need the quotes is wrong. You have explicitly defined 'id' as an INTEGER. Probably the first thing to find out is whether it's the INSERT or the SELECT commands which are acting differently. I suspect that somehow somewhere you have some funny quote marks creeping in. On both copies of the database can you use the command-line tool to display the contents of the Directors TABLE and see if you get identical results ? Probably simplest to use '.dump Directors': http://www.sqlite.org/sqlite.html You could also swap the files (copy the one from Windows to Gentoo and vice versa), and see whether the need for quotes follows the databases around. Simon. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

