wap3
11-21-2002, 08:14 PM
Ok so I have thi sproblem
I have a form which the user fills in clicks submit and the action is set to page.php where the following code is. Amonsgt other things it it suppose to get the field values and put them in my database. At the moment I have two fields which I want put in the database. This does not work however. It only works when I say put Item_id into the database. Why would this only be working for one field ??
I am really stuck here so any help will be really appreciated
Thanks guys :thumbsup:
<?
include ('site_fc_library.php');
session_start();
if (check_admin_user())
{
if(insert_item('$Item_id', '$Half_Day'))
echo "Book '$Description' was added to the database.<br>";
else
echo "Book '$Description' could not be added to the database.<br>";
}
else
include ('er_login.php');
function insert_item($Item_id, $Half_Day)
// insert a new book into the database
{
$conn = db_connect();
// check category does not already exist
// insert new category
$query = "insert into products values ('$Item_id', '$Half_Day')";
$result = mysql_query($query);
if (!$result)
echo "no result";
else
return true;
}
?>
I have a form which the user fills in clicks submit and the action is set to page.php where the following code is. Amonsgt other things it it suppose to get the field values and put them in my database. At the moment I have two fields which I want put in the database. This does not work however. It only works when I say put Item_id into the database. Why would this only be working for one field ??
I am really stuck here so any help will be really appreciated
Thanks guys :thumbsup:
<?
include ('site_fc_library.php');
session_start();
if (check_admin_user())
{
if(insert_item('$Item_id', '$Half_Day'))
echo "Book '$Description' was added to the database.<br>";
else
echo "Book '$Description' could not be added to the database.<br>";
}
else
include ('er_login.php');
function insert_item($Item_id, $Half_Day)
// insert a new book into the database
{
$conn = db_connect();
// check category does not already exist
// insert new category
$query = "insert into products values ('$Item_id', '$Half_Day')";
$result = mysql_query($query);
if (!$result)
echo "no result";
else
return true;
}
?>