I have made a field in a form that is saved to the database. <input type="text" name="dau" class="text" value="<?php echo $settings['dau'] ?>" /> Code (markup): In this code, I would like to replace the number 55 with the information that is placed in the field and saved to the database from the first example. $insert = $db->query_insert("tickets",$data); mysql_query("INSERT INTO `important`.`support_assigned` (`ID` ,`USER_ID` ,`TICKET_ID` ,`date`) VALUES (NULL , '55', '".$insert."',CURRENT_TIMESTAMP)"); Code (markup): Anyone know how I can do this? Thank you in advanced.
Capture the value of form field thru $dau_value = $_POST['dau']; Replace "55" with the variable "$dau_value"
$dau = $_POST['dau']; mysql_query("INSERT INTO `important`.`support_assigned` (`ID` ,`USER_ID` ,`TICKET_ID` ,`date`) VALUES (NULL , ".$dau.", '".$insert."',CURRENT_TIMESTAMP)"); PHP: Finau
Neither one of these worked. Doesn't it have to call it from the right spot in the database and not just dau? It's in a spot named Settings.
On your <form what is the method ? is it get or post and is there an action=, if so what is that action ?
Here's what the file with the form says: if (isset($_POST['submit'])) { $q15 = $db->query("UPDATE ".DB_TABLE."settings SET value = '".trim($_POST['dau'])."' WHERE name = 'dau';"); Code (markup): Here's what's in the form: <input type="text" name="dau" class="text" value="<?php echo $settings['dau'] ?>" /> Code (markup):