Jump to content

last problem - update query problem


aebstract

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.