Jump to content

SQLite question


d0n
 Share

Recommended Posts

Hi, trying to move my ini stuff into SQLite and had a quick question

If i had a database name "Fruits" and it looked like this

Fruit a b c

Apple 17 23 31

Orange 13 43 21

Banana 9 12 32

is it possible to find say, the data from Apple on column b (which would be 23)

I have something like this so far, but it doesn't seem to return the correct one

_SQlite_Query (-1, "SELECT b FROM Fruit ORDER BY Fruit;", $hQuery)
_SQLite_FetchNames ($hQuery, $aNames)
_SQLite_FetchData ($hQuery, $aRow)
ConsoleWrite(@LF&$aRow[0]&@LF)

Also i am not quite sure what Order by really does? if all i want is to find a data in a cell

Link to comment
Share on other sites

If i had a database name "Fruits" and it looked like this

Fruit a b c

Apple 17 23 31

Orange 13 43 21

Banana 9 12 32

is it possible to find say, the data from Apple on column b (which would be 23)

I have something like this so far, but it doesn't seem to return the correct one

_SQlite_Query (-1, "SELECT b FROM Fruit ORDER BY Fruit;", $hQuery)

...

Also i am not quite sure what Order by really does? if all i want is to find a data in a cell

the query should be:

SELECT b FROM Fruits WHERE Fruit="Apple"

If the result is a single row then the ORDER clause has no meaning

Attention: Fruits is not the database but is the table as a database can have more than a table.

Link to comment
Share on other sites

How does one write to disk using sqlite - I tried and it did nothing....help!

Specify the file name in _SQLite_Open(). If it doesn't exist, a new DB file will be created.

:)

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...