Stumped on this one and after hours of struggle and would very much appreciate any help.
Have a form that posts to a php file that contains the code below.
I want to select state_province_price from table_name2 where origin_state_province is determined by the user set $origin_state_province in the form and destination_state_province is determined by the user set $destination_state_province in the form.
Then I want to insert state_province_price into table_name.state_price.
Here is what i have come up with so far.
<?
$table_name = "email_quotes";
$table_name2 = "pair_price";
$sql = "INSERT INTO $table_name
( state_price)
VALUES
(\"SELECT state_province_price
FROM $table_name2 WHERE origin_state_province = $origin_state_province AND destination_state_province = $destination_state_province\")
";
$result = @($sql,$connection) or die("Couldn't execute query.");
?>