Ok, heres an odd situation.
I've been using a code for a few years to basically add edit, and delte content from my site.
I have taken this bit of code and once again am using it to add some content. ARGH! I can't figure this out for the life of me! The data I am trying to write won't insert into my database. I've checked everything three times and it looks good.
I have also checked my old scripts to see if the mysql or php was upgraded into incompatibility and those old scripts seem to work.
Ok here goes the code:
<?
// This file is used for administraton of the Estimate Request pages.
$dbhost = "localhost";
// MySQL server username
$dbuser = "reliable_om1";
// MySQL server password
$dbpasswd = "removed for security";
// MySQL server connect
$db=mysql_connect("$dbhost","$dbuser","$dbpasswd");
// MySQL database name
$db_name="reliable_relamedata";
mysql_select_db($db_name,$db);
$table="estimate_requests";
$query = "SELECT * FROM $table WHERE firstName='$firstName' ";
$result = mysql_query($query);
$nombre = mysql_numrows($result);
//_________________________ADD__________________________
if ($action=='add' and $nombre == 0 ) {
$query="INSERT INTO $table ('firstName', 'lastName', 'orginization', 'jobAddress', 'jobCity', 'jobState', 'jobZip', 'mailAddress', 'mailCity', 'mailState', 'mailZip', 'dayPhone', 'evePhone', 'cellPhone', 'faxNo', 'eMail', 'workType', 'estimateDesc', 'referrer') VALUES ('$firstName', '$lastName','$orginization', '$jobAddress', '$jobCity','$jobState', '$jobZip','$mailAddress', '$mailCity','$mailState', '$mailZip', '$ dayPhone', '$evePhone', '$cellPhone', '$faxNo', '$eMail', '$workType', '$estimateDesc', '$referrer')";
$result=mysql_query($query);
echo "The entry $firstName $lastName was added to the Lead Bank.<br>" ;
echo "<a href=\"open_estimates.php\">View Open Estimates.</a>
<a href=\"index.php\">Return to Employee Home Page.</a> <br>" ;
mysql_close();
exit;
}
elseif ($action=='add' and $nombre != 0) {
echo "No Addition, the entry <b>$id</b> exist in the glossary" ;
mysql_close();
exit ;
}
//more code removed for convenience
?>
The interface used is found at: http://relamedata.reliableamerican.us/UnnamedSite/new_estimate.php upon submission of the form it appears as if the data is added, but no data is added to the database when I check through phpMyAdmin
The file with the above code is found at: http://relamedata.reliableamerican.us/UnnamedSite/estimate_request_engine.php