insert variable into database
Posted: Tue May 01, 2007 2:55 pm
I am back again.
I am trying to alter an existing php page. I have added another form to the page. The new form searches the database based upon user criteria typed into text box. The second button basically runs a INSERT statement. Everything is working except I can not add new Fields and Values to insert statement. This is what it looks like before :
This is what it looks like after I add one filed to it:
If I put echo $parcel; before the query statement nothing happens. If I put echo $parcel or any other of the text boxes near the top of the page I get back the current value of that text box.
I am stumped.
Thanks in advance.
I am trying to alter an existing php page. I have added another form to the page. The new form searches the database based upon user criteria typed into text box. The second button basically runs a INSERT statement. Everything is working except I can not add new Fields and Values to insert statement. This is what it looks like before :
Code: Select all
$query = "INSERT INTO data (status, category, owner, realname, created, description, department, comment, default_rights, publishable) VALUES(0, '" . addslashes($_REQUEST['category']) . "', '" . addslashes($_SESSION['uid']) . "', '" . addslashes($_FILES['file']['name']) . "', NOW(), '" . addslashes($_REQUEST['description']) . "','" . addslashes($current_user_dept) . "', '" . addslashes($_REQUEST['comment']) . "','" . addslashes($_REQUEST['default_Setting']) . "', $lpublishable )";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());Code: Select all
$query = "INSERT INTO data (status, category, owner, realname, created, description, department, comment, default_rights, publishable,TAXROLL_PIN) VALUES(0, '" . addslashes($_REQUEST['category']) . "', '" . addslashes($_SESSION['uid']) . "', '" . addslashes($_FILES['file']['name']) . "', NOW(), '" . addslashes($_REQUEST['description']) . "','" . addslashes($current_user_dept) . "', '" . addslashes($_REQUEST['comment']) . "','" . addslashes($_REQUEST['default_Setting']) . "', $lpublishable,'$parcel' )";
$result = mysql_query($query, $GLOBALS['connection']) or die ("Error in query: $query. " . mysql_error());I am stumped.
Thanks in advance.