Username and Password authentication using pqxx library.

Поиск
Список
Период
Сортировка
От aravind chandu
Тема Username and Password authentication using pqxx library.
Дата
Msg-id 946116.34930.qm@web31406.mail.mud.yahoo.com
обсуждение исходный текст
Ответы Re: Username and Password authentication using pqxx library.  (Klint Gore <kgore4@une.edu.au>)
Список pgsql-general
Hello,

            I am using pqxx API for postgresql.The following is the part of my code.The problem is in the query I am selecting the number of rows from the table since there is only one user name and password row it should return 1 and if there is no match then it should return 0.But here Even though I give wrong username or password its getting authenticated.please help me,what should I put in the "if ()" statement inorder to solve this issue .

result R(T.exec("select count(*) from dbtable where username="+username+" and password="+password+""));
   
    if (R.empty())
        {
            throw logic_error("No tables found");
            *shm = '5';
        }
    else
        {
            cout<<"Authenticated";
            *shm='0';
        }

Thank You,
Avinash.

В списке pgsql-general по дате отправления:

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: Re: Quiet "CONTEXT"?
Следующее
От: Tom Allison
Дата:
Сообщение: postgresql and Mac OS X