Hey all,
Selecting a MYSQL Database is throwing Errors. It's all correct. However, My page seems to think otherwise..
<?php
################### Server Connection / CONST ######################
define('DB_NAME', 'xtrapsp_Rhino');
define('DB_USER', 'xtrapsp_rhino');
define('DB_PASSWORD', 'Password');
define('DB_HOST', 'localhost');
##################################################################
// Note that whatever is enclosed by $_POST[""] matches the form input elements
// $Value_name = $_POST["Form_Name"];
$value_customer_name = $_POST["customer_name"];
$value_customer_name_letterhead = $_POST["customer_name_letterhead"];
// Connect to our DB with mysql_connect(<server>, <username>, <password>)
$sql_connection = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
mysql_select_db(DB_NAME , $sql_connection);
$sql = "INSERT INTO Customers(
customer_name,
customer_name_letterhead
) VALUES (
'$value_customer_name',
'$value_customer_name_letterhead'
)";
if (!mysql_query($sql)) {
die('Error: ' . mysql_error());
}
mysql_query(mysql_real_escape_string($sql), $sql_connection);
mysql_close($sql_connection);
?>
As you can see the script itself is very basic. It will submit data to two rows inside a table called Customers.
Database details:
localhost - xtrapsp_Rhino - Customers
Picture:
It all lines up... I don't see the error.