Hmm - I get this error
Code:
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 '' at line 1
in:
[SELECT customers_password FROM zen_customers WHERE customers_id=]
And the code I have copied and pasted from above and placed exactly where recommended in includes/modules/pages/login/header_php.php is
Code:
if (substr_count($_COOKIE["zencart_cookie_permlogin"], "~~~") > 1) {
		if (empty($_SESSION['customer_id'])) {
			$c = explode("~~~", $_COOKIE["zencart_cookie_permlogin"]);

			$q = "SELECT customers_password FROM " . TABLE_CUSTOMERS . " WHERE customers_id=" . $c[0];
			$r = $db->Execute($q);

			$pw_cookie = zen_db_prepare_input($c[7]);
			$pw_zencart = $r->fields['customers_password'];

			if ($pw_cookie == $pw_zencart) {
				$_SESSION['customer_id'] = $c[0];
				$_SESSION['customer_default_address_id'] = $c[1];
				$_SESSION['customers_authorization'] = $c[2];
				$_SESSION['customer_first_name'] = $c[3];
				$_SESSION['customer_last_name'] = $c[4];
				$_SESSION['customer_country_id'] = $c[5];	
				$_SESSION['customer_zone_id'] = $c[6];
				$_SESSION['cart']->restore_contents();
			}
		}
	}
I'm no expert, but there doesn't seem to be anything wrong with that. And I've checked in the db that the required data is present.