I need to be able to use the dynamically generated $colname in my Mysql. How do you that?
This is the script that I’ve got so far…but it doesn’t give me the same colname that comes up in the URL id. Any thoughts?
$last_id = mysql_insert_id();
$service_id = $colname_rst_provider = “1”;
if (isset($_GET[‘tbl_service.service_id’])) {
$colname_rst_provider = (get_magic_quotes_gpc()) ? $_GET[‘tbl_service.service_id’] : addslashes($_GET[‘tbl_service.service_id’]);
}
if ((isset($_POST[“MM_insert”])) && ($_POST[“MM_insert”] == “add_provider_form”)) {
$insertSQL = sprintf(“INSERT INTO tbl_link (provider_id, service_id) VALUES ($last_id, $service_id)”,
GetSQLValueString($_POST[‘tbl_link.provider_id’], “int”),
GetSQLValueString($_POST[‘tbl_link.service_id’], “int”));
mysql_select_db($database_ConnServices, $ConnServices);
$Result1 = mysql_query($insertSQL, $ConnServices) or die(mysql_error());
}