this works fine:
<?php
session_start();
$user = $_SESSION [\'user\' ] ;
$user_id= $_SESSION [\'user_id\' ] ;
$item1=$HTTP_POST_VARS[item1];
$item2=$HTTP_POST_VARS[item2];
$item3=$HTTP_POST_VARS[item3];
require_once(\'../Connections/camelgrooves.php\');
$sql= \"INSERT INTO test1 (id, user_id, item1, item2, item3)
VALUES (\'\',\'$user_id\', \'$item1\', \'$item2\', \'$item3\')\" ;
mysql_db_query ($database_camelgrooves,$sql,$camelgrooves);
?>
now, the same function should be used with different tables (similar structure but different number of columns (id, user_id, item1, item2, ...itemx). i can\'t figure out how to get the variables and how to write the $sql string.
i\'d lik to be able to do this
test1 form => 8 form variables sent => INSERT INTO test1 (id, user, item1, ...item6)
and this
test2 form => 10 form variables sent => INSERT INTO test2 (id, user, item1,...item8)
and ...
can somebody help me?