Jump to content
Sign in to follow this  
stevennickelby

help with syntax error

Recommended Posts

I'm getting the following error

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''affiliate_affiliate where affiliate_email_address = ''' at line

 

select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from customers where customers_email_address = 'affiliate_affiliate where affiliate_email_address = ''

 

[TEP STOP]

 

 

the script that it realtes to is...

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($email_address) . "'");

if (!tep_db_num_rows($check_customer_query)) {

$error = true;

} else {

$check_customer = tep_db_fetch_array($check_customer_query);

 

 

can customers_email_address, and affiliate_email_address be used for ($email_address)

???

Share this post


Link to post
Share on other sites
I'm getting the following error

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''affiliate_affiliate where affiliate_email_address = ''' at line

 

select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from customers where customers_email_address = 'affiliate_affiliate where affiliate_email_address = ''

 

[TEP STOP]

the script that it realtes to is...

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . TABLE_AFFILIATE . " where affiliate_email_address = '" . tep_db_input($email_address) . "'");

if (!tep_db_num_rows($check_customer_query)) {

$error = true;

} else {

$check_customer = tep_db_fetch_array($check_customer_query);

can customers_email_address, and affiliate_email_address be used for ($email_address)

???

 

You can't have 2 where clauses. Not sure if this has been caused by adding a contribution but you might want to try the following:

 

$check_customer_query = tep_db_query("select customers_id, customers_firstname, customers_lastname, customers_password, customers_email_address, customers_default_address_id, affiliate_id, affiliate_firstname, affiliate_password, affiliate_email_address from " . TABLE_CUSTOMERS . " where customers_email_address = '" . tep_db_input($email_address) . " and affiliate_email_address = '" . tep_db_input($email_address) . "'");

 

In this case you will need an email address in the $email_address variable and affiliate_email_address needs to be a column in the customers table AND both email fields need to have the same email address in it.

HTH

 

Gunter

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×