Hi! I know this has to be something fairly simple that I just don't know about. I'll start off with the fact that I make no claim to be a PHP/MySQL programmer - I've just been hacking my way through this stuff to get some simple stuff built, and enjoying the process I might add.
But I am including a section of code that is SUPPOSED to add info into a database, but does not. No errors, no hang ups, it just runs the way it is supposed to. I have spent a while searching through these forums for something to shed light on the matter, unsuccessfully.
Any help would be greatly appreciated!
if ($HTTP_GET_VARS['action'] == 'process') {
$db = mysql_connect("******", "*******","********");
mysql_select_db("123",$db);
$result_query = mysql_query("SELECT * FROM lstgDirectory WHERE (dma='" . $HTTP_POST_VARS['city'] . "' AND state='" . $HTTP_POST_VARS['state'] . "' AND lstg_num='" . $HTTP_POST_VARS['lstg_num'] . "')",$db);
if ($result = mysql_fetch_array($result_query)) {
include("construction_exists.php");
} else {
/// All above code responds correctly, and does stream the page response correctly, so I know the variables are working. This next part is what totally gets ignored (or seems to)
$db2 = mysql_connect("*****", "*******","********");
mysql_select_db("123",$db2);
$new_const = "INSERT INTO lstgDirectory (lstg_num, last_action, address) VALUES ('" . $HTTP_POST_VARS['lstg_num'] . "','construction','" . $HTTP_POST_VARS['address'] . "')";
$result = mysql_query($new_const);
include("construction_success.php");
}
} else { ..... code continues as planned from here on out.