I think I put everything in correctly but now I'm getting this message: Unknown column 'product_id' in 'field list'
Here is the source code followed by the connections script:
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO karen (product_id, product_type, product_name, price, packaging, materials, serial_number, `size`, thumbnail) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['product_id'], "int"),
GetSQLValueString($_POST['product_type'], "text"),
GetSQLValueString($_POST['product_name'], "text"),
GetSQLValueString($_POST['price'], "double"),
GetSQLValueString($_POST['materials'], "text"),
GetSQLValueString($_POST['materials'], "text"),
GetSQLValueString($_POST['serial_number'], "text"),
GetSQLValueString($_POST['size'], "text"),
GetSQLValueString($_POST['thumbnail'], "text"));
mysql_select_db("karenke1_products");
$Result1 = mysql_query($insertSQL, $karen_product) or die(mysql_error());
}
mysql_select_db("karenke1_products");
$query_rsProducts = "SELECT product_id, product_type, product_name, price, packaging, materials, serial_number, `size`, thumbnail FROM karen";
$rsProducts = mysql_query($query_rsProducts, $karen_product) or die(mysql_error());
$row_rsProducts = mysql_fetch_assoc($rsProducts);
$totalRows_rsProducts = mysql_num_rows($rsProducts);
mysql_select_db("karenke1_products");
$query_rsType = "SELECT * FROM type";
$rsType = mysql_query($query_rsType, $karen_product) or die(mysql_error());
$row_rsType = mysql_fetch_assoc($rsType);
$totalRows_rsType = mysql_num_rows($rsType);
mysql_select_db("karenke1_products");
$query_rsAdmin = "SELECT * FROM users";
$rsAdmin = mysql_query($query_rsAdmin, $karen_product) or die(mysql_error());
$row_rsAdmin = mysql_fetch_assoc($rsAdmin);
$totalRows_rsAdmin = mysql_num_rows($rsAdmin);
?>
connections script:
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_karen_product = "localhost";
$database_karen_product = "karenke1_products";
$username_karen_product = "root";
$password_karen_product = "root";
$karen_product = mysql_connect('localhost', 'karenke1_admin', 'password goes here') or trigger_error(mysql_error(),E_USER_ERROR);
?>
Appreciate your help