Mysql connections

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • hiddenhole
    Forum Member
    • May 2006
    • 24

    Mysql connections

    Hey just a few questions, ok i have an application, i have figured out how to get it to connect to a remote database ect.

    Is it possible for me to use the WHERE clause to compare resaults from a variable already assigned in order to filter records returned.

    (ps cheers for the info on connecting to database bule)

    ie:
    Code:
    --Obtain user details from the reg.
    userid = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\creo\\intouch\\1.0", "cli_id", true);
    
    --return user details filtered by userid variable
    
    ListBox.DeleteItem("users", -1);	
    cur = assert (con:execute"SELECT name,user_id FROM nmx WHERE user_id = "..userid.." ")
    row = cur:fetch ({}, "a")
    while row do
      ListBox.AddItem("ListBox1", row.name.."");
      row = cur:fetch (row, "a")
    end
    cur:close();
    i understand == is the "is equal to" syntax in lua, but does this still apply to sql statements ???

    iam a bit of a dumba$$ so excuse my stupidty, lua is kind of new to me (but i love what i have seen thus far)
  • hiddenhole
    Forum Member
    • May 2006
    • 24

    #2
    Nevermind i figured it out.

    it was not my query that was the drama, it was the way i was recalling the returned data.

    ciao

    Comment

    Working...
    X