This topic is locked

Drop down lists in v 4.0

5/12/2007 9:33:31 PM
PHPRunner General questions
H
hlewis author

I have the following code in use as an after successful login event:
function AfterSuccessfulLogin()

{

//** Custom code ****

// put your custom code here

global $conn;

$strSQL = "select * from account,contacts where account.user_name='".$_SESSION["UserID"]."'";

$rs = db_query($strSQL,$conn);

$data=db_fetch_array($rs);

$_SESSION["account.account_id"]= $data["account.account_id"]; $_SESSION["user_name"]= $data["user_name"]; $_SESSION["password"]= $data["password"]; $_SESSION["title"]= $data["title"]; $_SESSION["contact_name"]= $data["contact_name"];

$_SESSION["contact_email"]= $data["contact_email"]; }
Tables account and contacts both have a column account_id and user_name. On an add page I am trying to use drop down lists and filter according to the logged in user. However, when I put in the following as the WHERE condition : , I get this error message:
[color=#FF0000]odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'account_id='., SQL state 37000 in SQLExecDirect
This worked ok before I purchased the software and went from 3.1 trial to v 4.0.
Anyone help please?

T
thesofa 5/12/2007

I have the following code in use as an after successful login event:

$strSQL = "select * from account,contacts where account.user_name='".$_SESSION["UserID"]."'";
Anyone help please?



you seem to have a comma between account and contacts, should it be a full stop?

H
hlewis author 5/13/2007



you seem to have a comma between account and contacts, should it be a full stop?


Don't think so, they are two separate tables?

J
Jane 5/14/2007

answered in your personal email.