Announcement

Collapse
No announcement yet.

SQL search

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • sim
    replied
    Originally posted by JimS View Post
    You are probably going to want to use LIKE and wildcards.
    Take a look at
    http://www.w3schools.com/sql/sql_like.asp
    Also thaks JimS that link was useful

    Leave a comment:


  • sim
    replied
    Originally posted by webultra View Post
    Nop, I don't think you could get a result if the string to search is encrypted. This because if you have the word "HELLO" encrypted and stored in your database then the recorded value could be something like "FGT#$RC#$" (just an example), and if the string to search is something like "HELLo", "HeLlo" or "****" then the encrypted value is another totally diferent like "Ff43ffDKFDJI". That's the little problem with encrypted stored data.
    I could use string to lower all the time, thing Is I have to make it work with the DB has shes pushing over 700 books and I think she would kill me If I lost all the books lol.

    Leave a comment:


  • webultra
    replied
    Nop, I don't think you could get a result if the string to search is encrypted. This because if you have the word "HELLO" encrypted and stored in your database then the recorded value could be something like "FGT#$RC#$" (just an example), and if the string to search is something like "HELLo", "HeLlo" or "****" then the encrypted value is another totally diferent like "Ff43ffDKFDJI". That's the little problem with encrypted stored data.

    Leave a comment:


  • sim
    replied
    I will test that thanks Reset but I am ecrypting before its sent in the search so I think it should be ok right?

    Leave a comment:


  • reteset
    replied
    replace your query with this

    Code:
    "SELECT * FROM bookstore where " .. sData.. " like '%" .. Enclose(SimplyR.Encrypt(sText)) .. "%'"
    but if actual data is encrypted this search will fail
    because search will never match with any entry of database
    and encryption will produce a different text

    Leave a comment:


  • JimS
    replied
    You are probably going to want to use LIKE and wildcards.
    Take a look at
    http://www.w3schools.com/sql/sql_like.asp

    Leave a comment:


  • sim
    started a topic SQL search

    SQL search

    I need little help a few months back I made my partner a program so she could keep track of her books, anime & manga


    Click image for larger version

Name:	App.png
Views:	1
Size:	184.5 KB
ID:	287969



    I am having a problem she wants to have a partial search and I can only do a fixed search.

    Here is my function:

    PHP Code:

    function SimplyR.Search(eListsTextsData)
        
    SimplyR.SQLOpen();
        
    tbReturn SQLite.QueryToTable(db"SELECT * FROM bookstore where " .. sData.. " = " .. Enclose(SimplyR.Encrypt(sText)) .. "");
        
    ListBox.DeleteItem(eListLB_ALLITEMS);
        if 
    tbReturn and tbReturn.Rows 0 then
            
    for i,v in pairs(tbReturn.Data) do
                
    ListBox.AddItem(eListSimplyR.Decrypt(tbReturn.Data[i]["book"]), tbReturn.Data[i]["id"]);
            
    end
        end
    end 
    she want to add to the search lets say manga and get everything with manger in the title in that topic.

    Or if she search's for a writer and only remebers the first name I can get it to search the right parts just not do a partial search any ideas
Working...
X