aebstract Posted April 1, 2008 Share Posted April 1, 2008 if (!$problem) { $change_bgcolor = $_POST['change_bgcolor']; $change_modified = date(U); $edit = $_GET['edit']; $query = "UPDATE albums SET bgcolor=$change_bgcolor, date_modified=$change_modified WHERE superid=$edit"; $r = mysql_query ($query); header("Location: index.php?page=album&album=$edit"); exit(); } This is the process that updates the database with the information. Here is the form for this: <form action=\"index.php?page=edit&edit=$edit\" method=\"post\"> Current color: $album_bg_color<br /> <input type=\"text\" size=\"6\" maxlength=\"6\" name=\"change_bgcolor\" /> <br /> <input type=\"submit\" name=\"submit\" value=\"submit\" /> </form> It is submitting the timestamp that is being created by $change_modified in to the bgcolor and the last modified columns.. I am trying to get the form field to enter in to bgcolor. I also can't get it to set the variable to "#ffffff" vs "ffffff". How can I get the # in front of the value that they enter? Thanks! Link to comment https://forums.phpfreaks.com/topic/98909-last-problem-update-query-problem/ Share on other sites More sharing options...
ohdang888 Posted April 1, 2008 Share Posted April 1, 2008 $query = "UPDATE albums SET bgcolor='$change_bgcolor', date_modified='$change_modified' WHERE superid='$edit' "; and... mysql_query($query) or die(mysql_error()); Link to comment https://forums.phpfreaks.com/topic/98909-last-problem-update-query-problem/#findComment-506091 Share on other sites More sharing options...
aebstract Posted April 1, 2008 Author Share Posted April 1, 2008 How do I get the # in front of the value? Link to comment https://forums.phpfreaks.com/topic/98909-last-problem-update-query-problem/#findComment-506094 Share on other sites More sharing options...
ohdang888 Posted April 1, 2008 Share Posted April 1, 2008 $change_bgcolor = '#'.$_POST['change_bgcolor']; Link to comment https://forums.phpfreaks.com/topic/98909-last-problem-update-query-problem/#findComment-506106 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.