I am using Dreamweaver to build everything. I called the database criticver2 and the connections file is critic_ver_2. Sorry for syntax rules I should have looked at, but I had older versions with the same nam and didn't feel like changing and then finding/replacing the old stuff. Here is the Connections file:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_critic_ver_2 = "localhost";
$database_critic_ver_2 = "criticver2";
$username_critic_ver_2 = "username";
$password_critic_ver_2 = "password";
$critic_ver_2 = mysql_pconnect($hostname_critic_ver_2, $username_critic_ver_2, $password_critic_ver_2) or trigger_error(mysql_error(),E_USER_ERROR);
?>
I have the following at the top of every page:
<?php require_once('../Connections/critic_ver_2.php'); ?>
I have a form on the submit page that calls the upload page:
<?php require_once('../Connections/critic_ver_2.php');
$page_sort = $_POST['page_sort'];
$dir_sort = $_POST['dir_sort'];
$doc_review_id = $_POST['doc_review_id'];
$reviewer = $_POST['reviewer'];
$office = $_POST['office'];
$category = $_POST['category'];
$status = $_POST['status'];
$line_num = ltrim($_POST['line_num'],"0");
if($line_num <= '9') $line_num = '0'.$line_num;
$page = ltrim($_POST['page'],"0");
if($page <= '9') $page = '0'.$page;
$section = ltrim($_POST['section'],"0");
if($section <= '9') $section = '0'.$section;
$paragraph = ltrim($_POST['paragraph'],"0");
if($paragraph <= '9') $paragraph = '0'.$paragraph;
$remark = str_replace("\"","“",ltrim(ucfirst($_POST['remark'])));
$latest_reviewer = $_POST['reviewer'];
$original_reviewer = $_POST['original_reviewer'];
$query = "INSERT INTO input (doc_review_id, reviewer, original_reviewer, office, category, status, line_num, page, `section`, paragraph, remark, latest_reviewer) VALUES ('$doc_review_id', '$reviewer', '$original_reviewer', '$office', '$category', '$status', '$line_num', '$page', '$section', '$paragraph', '$remark', '$latest_reviewer')";
mysql_query($query) or die(mysql_error());
if(isset($_POST['return_to'])) {
header ("Location: ".$_POST['return_to']);
} else {
header ("Location: ".$_SERVER['HTTP_REFERER']);
};?>
I know this looks like garbage to some of you, but I'm trying. 🙂 Now, why would the program call tables that are in ANOTHER database vs. the one I'm calling in the include file?