Hi,
As the title suggest I am trying to write a code that will check the customers postcode is valid by running it through my postcode database.
This code is in includes/modules/create_account.php
if (strlen($postcode) < ENTRY_POSTCODE_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_POST_CODE_ERROR);
} else {
// check Zen Cart for duplicate postcode
$sql = "select * from " . TABLE_FASTWAY_ZONES . "
where f_postcode = ostcode:";
$check_postcode_query = $db->bindVars($sql, 'ostcode:', $postcode, 'string');
$check_postcode = $db->Execute($check_postcode_query);
if ($check_postcode->RecordCount() < 0 ) {
$error = true;
$messageStack->add('create_account', error message to go here...);
}
}
for some reason it returns an error:
1146 Table 'h-----p.table_fastway_zones' doesn't exist
in:
[select * from TABLE_FASTWAY_ZONES where f_postcode = '1001']
The table does exist - and this code below works:
$check_query = "SELECT count(*) AS total
FROM " . TABLE_ZONES . "
WHERE zone_country_id = :zoneCountryID";
So it shouldn't be an issue with the database prefix...
I'm working with 1.3.9h on a localhost setup if that helps..
Regards,
Mike.
Bookmarks