CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 error on login

Print topic Send  topic

Author Message
oasisp

Posts: 48
Posted: 12/07/2010, 11:32 AM

i am getting tons of php error on logs when any user login to the website
from login page
[07-Dec-2010 11:20:16] PHP Warning: odbc_exec() [<a href='function.odbc-exec'>function.odbc-exec</a>]: SQL error: [RBTI][Oterro ODBC Driver][rbaset]-ERROR- Column oasisp not found (2369), SQL state 42S22 in SQLExecDirect in C:\inetpub\wwwroot\website5\db_odbc.php on line 93

Here is line 93 code from db_odbc.php
$this->Query_ID = odbc_exec($this->Link_ID,$Query_String);
$this->Row = 0;
odbc_binmode($this->Query_ID, 1);

here common.php login scripts
function CCLoginUser($login, $password)
{
CCLogoutUser();
$db = new clsDBconn();
$SQL = "SELECT Login_ID, Group_ID, login_name, login_password FROM user WHERE login_name=" . $db->ToSQL($login, ccsText) . " AND login_password=" . $db->ToSQL($password, ccsText);
$db->query($SQL);
$Result = $db->next_record();
if ($Result) {
CCSetSession("UserID", $db->f("Login_ID"));
CCSetSession("UserLogin", $login);
CCSetSession("GroupID", $db->f("Group_ID"));

$login, $password are from login page text field
View profile  Send private message
quasimidi


Posts: 151
Posted: 12/08/2010, 1:59 AM

Hi,

It complains for a missing column: "-ERROR- Column oasisp not found "

What is you table structure for user login?

Regards,
_________________
RS
View profile  Send private message
oasisp

Posts: 48
Posted: 12/08/2010, 9:26 AM

oasisp is user trying to login - login_name is column name
here is database and sql common.php

$SQL = "SELECT Login_ID, Group_ID, login_name, login_password FROM user WHERE login_name=" . $db->ToSQL($login, ccsText) . " AND login_password=" . $db->ToSQL($password, ccsText);
$db->query($SQL);

View profile  Send private message
quasimidi


Posts: 151
Posted: 12/09/2010, 12:05 AM

Quote oasisp:
oasisp is user trying to login - login_name is column name
here is database and sql common.php

$SQL = "SELECT Login_ID, Group_ID, login_name, login_password FROM user WHERE login_name=" . $db->ToSQL($login, ccsText) . " AND login_password=" . $db->ToSQL($password, ccsText);
$db->query($SQL);


Hi,

Would you so kind to set the sql debug to true and copy/paste the generated query here please? (Just look for the 'Debug' parameter in sql common or in the db_odbc.php and set it to 1)

Regs,


_________________
RS
View profile  Send private message
oasisp

Posts: 48
Posted: 12/09/2010, 11:11 AM

i turn debug on. i dont see any error on login page.
here is sql query after i login
Debug: query = UPDATE user Set Last_Logon_Date = .#NOW WHERE Login_ID =501

Debug: query = SELECT COUNT(*) FROM user where login_name = 'oasisp '

Debug: query = SELECT Logon_Full_Name AS Logon_Full_Name FROM user where login_name = 'oasisp '

Here is php log error php-errors.log after i click on login button on login page.
[09-Dec-2010 11:05:22] PHP Warning: odbc_exec() [<a href='function.odbc-exec'>function.odbc-exec</a>]: SQL error: [RBTI][Oterro ODBC Driver][rbaset]-ERROR- Column ashishp not found (2369), SQL state 42S22 in SQLExecDirect in C:\inetpub\wwwroot\website5\db_odbc.php on line 96
View profile  Send private message
oasisp

Posts: 48
Posted: 12/09/2010, 11:18 AM

i was able get login page error by typing incorrect password. here is error on login page.

Debug: query = SELECT Login_ID, Group_ID, login_name, login_password FROM user WHERE login_name='oasisp' AND login_password='asdf'

Debug: query = UPDATE user Set Last_Logon_Date = .#NOW WHERE login_name =

Warning: odbc_exec() [function.odbc-exec]: SQL error: [RBTI][Oterro ODBC Driver][rbaset]-ERROR- Missing right side of comparison. (2295), SQL state HY000 in SQLExecDirect in C:\inetpub\wwwroot\website5\db_odbc.php on line 96
View profile  Send private message
quasimidi


Posts: 151
Posted: 12/10/2010, 6:52 AM

Hi,

To update the login datetime (is it datetime?) SQL you should use the builtin NOW() sql function not the ".#NOW" (as far as I know).
Have you tried to update your ODBC driver (are you using mysql)?

Regs,
_________________
RS
View profile  Send private message
oasisp

Posts: 48
Posted: 12/10/2010, 8:51 AM

i am using Rbase. rbase use ".#NOW" instead of NOW() function.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.