I have a database with columns that are constantly edited. so i have set up a database list for mysql to pull from to make or remove columns.
this doesnt seem to be working. I tried passing the variable $specs_product2 into the mysql code, but the value comes up zero.
here is the relevent part of the form…
[php]
Product:
<?php require_once('functions.php'); require_once('config.php'); connect(); // Product and quantity 1 $result = mysql_query("select DISTINCT ID,products from dropdown where products is not null order by products");echo '';echo "Choose Product"; while ($row = mysql_fetch_array($result)){ $id = $row["ID"]; $po = $row["products"]; echo "$po"; } echo ''; ?>Enter Manufacturing Specs Here
Product: <?php // Product and quantity 3 $result = mysql_query("select DISTINCT ID,products from dropdown where products is not null order by products");echo '';echo "Choose Product"; while ($row = mysql_fetch_array($result)){ $id = $row["ID"]; $po = $row["products"]; echo "$po"; } echo ''; ?> Quantity:
[/php]and here is post_product_specs.php…
[php]<?php
require_once(‘functions.php’);
require_once(‘config.php’);
connect();
///Specs
$specs_product1= make_safe($_POST[‘product1’]);
$add=“INSERT INTO product_specs (product) VALUES (’$specs_product1’)”;
if (!mysql_query($add)) {
die('error uploading content: ’ . mysql_error());
}
if(empty($_POST[‘quantity1’])) {}
else {
$specs_product2= make_safe($_POST[‘product2’]);
$specs_quantity1= make_safe($_POST[‘quantity1’]);
$quantity= $specs_quantity1 * -1;
$add=“INSERT INTO product_specs (” . $specs_product2 . “) VALUES (’$quantity’)”;
if (!mysql_query($add)) {
die('error uploading content: ’ . mysql_error());
}
}
?>[/php]
I hope ive explained myself well enough, im not always good at getting everything out of my head. I basically just want to pass $variables like this…
[php]Mysql_query(" INSERT INTO table1 (" . $variable1 . “) VALUES (’$value1’)”;[/php]
Thanks in advance!