PDA

View Full Version : AND OR NOT With Sqlite ?



roti
02-19-2007, 04:09 AM
hi every one ;)

it is another strange Quistion :D

How can i use AND , OR , NOT with my project?

i want to put check boxes one for each value ( AND , NOT , OR ) and when i select the box the search in the next field will get the value

i.e Title Windows AND Author Mark :o

is it clear :p

bule
02-19-2007, 04:42 AM
Well simply concat the query... here is a hint:


query=" <some query> where ";

title=title --for example "windows"
operator=operator --for example "AND" --> set this on your checkboxes event
author=autor --for example "mark"

query=query.."title='"..title.."' "..operator.." "..author='"..autor.."'"

roti
02-21-2007, 01:30 AM
Well simply concat the query... here is a hint:


query=" <some query> where ";

title=title --for example "windows"
operator=operator --for example "AND" --> set this on your checkboxes event
author=autor --for example "mark"

query=query.."title='"..title.."' "..operator.." "..author='"..autor.."'"

thank alot :yes

but how can i use these operators with combo box :o

as seen on attached image :huh

bule
02-21-2007, 06:42 AM
Well first.... if you have three input boxes, then you need only two comboboxes.

TJ_Tigger
02-21-2007, 08:42 AM
What is being typed into the input boxes. Is the user supposed to type Select * from mytable or are they just going to enter search criteria and not column or table information?

In any case you will have to use some if statements to check and see if there is anything populated in the inputbox. If there is then you can add it to your query.

sQuery = "Select * from mytable"
if Input.GetText("input1") then
sQuery = sQuery .. " where column = " .. Input.GetText("input1")
if Input.GetText ("input2") then
nConj = ComboBox.GetItemText("ComboBox", nSel)
sQuery = sQuery .. ", " .. nConj .. " column = " .. Input.GetText("input1")
end
end

or something like that anyway.

HTH
Tigg