1 Replies - 839 Views - Last Post: 23 September 2012 - 05:43 AM Rate Topic: -----

#1 shurd  Icon User is offline

  • D.I.C Head

Reputation: 37
  • View blog
  • Posts: 162
  • Joined: 05-February 12

SQLite Inverted select

Posted 23 September 2012 - 05:24 AM

Hey there guys, I'm inserting values into a table but when I retrieve it two column end up inverted.

The table is created as
CREATE TABLE contas (nome TEXT, email TEXT, senha TEXT, data TEXT, idade TEXT, clearance TEXT)

Than I insert
comandoSQL = "INSERT INTO contas VALUES (";
      comandoSQL += "'" + acc.getNome().getValor() + "', ";
      comandoSQL += "'" + acc.getEmail().getValor() + "', ";
      comandoSQL += "'" + acc.getSenha().getValor() + "', ";
      comandoSQL += "'" + acc.getData().getValor() + "', ";
      comandoSQL += "'" + acc.getIdade().getValor() + "', ";
      comandoSQL += "'" + acc.getClearance().getValor() + "')";

And finally retrieved with
comandoSQL = "select nome from contas where email = '";
comandoSQL += mail.getValor();
comandoSQL += "';";


comandoSQL = "select senha from contas where email = '";
comandoSQL += mail.getValor();
comandoSQL += "';";


comandoSQL = "select data from contas where email = '";
comandoSQL += mail.getValor();
comandoSQL += "';";


comandoSQL = "select idade from contas where email = '";
comandoSQL += mail.getValor();
comandoSQL += "';";


comandoSQL = "select clearance from contas where email = '";
comandoSQL += mail.getValor();
comandoSQL += "';";



In english nome = name, senha = password, data = date(in my program it's birthday date), idade = years old.
I am using C++ to use the SQLite. If there's any need to post the callback you just gotta ask for it.
Selected values work fine except for data and idade, those two are inverted.
Would anyone know why?

Is This A Good Question/Topic? 0
  • +

Replies To: SQLite Inverted select

#2 shurd  Icon User is offline

  • D.I.C Head

Reputation: 37
  • View blog
  • Posts: 162
  • Joined: 05-February 12

Re: SQLite Inverted select

Posted 23 September 2012 - 05:43 AM

Forget it guys, solved it. The problem was a missing ; in the insert values
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1