Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi guys,
im having a few problems in getting a script to work, bascially what i am trying to do is.
We have more than 6+ stores, the website must know where to send the online order to (email address).
so basically the code would look something like this,
To select which store to send the email to, we want to use postcodes.
each store has their own set areas for sales based on postcodes, for instance 1 store would have 4512, 4533 and many more stored in the franchise table in the database.
-----
Example:
i am placing an order for 1x Audio Device at a total cost of $299.90 including shipping,
my postcode equals 4512 ($customerpostcode)
The script should automatically know that i am in zone b, therefore the $selectedstore equals the store that has that postcode assosiated with it in the database.Code: Select all
// MYSQL Connection Script BOF //
$dbcnx = mysql_connect('localhost', 'root', 'mypasswd');
$dbcnx = @mysql_connect('localhost', 'root', 'mypasswd');
if (!$dbcnx) {
echo '<p>Unable to connect to the ' .
'database server at this time.</p>' );
exit();
}
$mysql_select_db('database1', $dbcnx);
if (!@mysql_select_db('database1')) {
exit('<p>Unable to locate the' .
'database at this time.</p>');
}
// Connection Script EOF //if (!$result) {
exit('<p>Error performing query: ' . mysql_error() .
'</p>');
}
My question relates to the bottom part of the code, the select statement.
What is the syntx for the following select command,
Code: Select all
SELECT entry_postcode FROM address_book WHERE entry_postcode is equal to (question, can i use a variable in this select statement like below???)Code: Select all
SELECT entry_postcode FROM address_book WHERE entry_postcode == "$storepostcode" ???Code: Select all
SELECT entry_postcode FROM address_book WHERE entry_postcode = ". ' && ' ."Pimptastic | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]