Here is the situation... I'm including a php file which contains all my functions and variables. i'm doing this at the top of my main file (which is 'prototype.php3'). I do it this way:
<?php
require("functions.php3");
//Functions and vars
So when I call the function that I want to use nothing happens. After doing some manual testing I found that it was a problem with the variables. My error happens at the select $dbname line. I have the variables and function setup like this in the functions.php.
$dbserver = 'localhost';
$loginid = 'webdb';
$password = 'computer';
$dbname = 'classeval';
function insertinstructor($ssn,$first,$middle,$last,$email,$date,$passwd){
$mysql_access = mysql_connect($dbserver,$loginid,$password) or die("Database Unavailable.");
mysql_select_db($dbname) or die(reporterror());
$query = "INSERT INTO INSTRUCTOR (INSTRUCTOR_ID, FIRST_NAME, MID_NAME, LAST_NAME, DATE_ADDED, PASSWORD, EMAIL)";
$query .= " VALUES ('$ssn','$first','$middle','$last','$date','$passwd','$email')";
mysql_query($query, $mysql_access) or die(reporterror());
mysql_close();
return;
}
What's my error here?