update date

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jamrop
Forum Commoner
Posts: 80
Joined: Fri May 16, 2003 5:38 pm

update date

Post by jamrop »

I have a table

FIlm_id, Film_name, Date(date)

If i update a film, i want to be able to automically change the date to when i updated it, I have got this code, i know it is wrong. Any help plz

Code: Select all

<?php

$db =mysql_connect("localhost","jam", "");
mysql_select_db("ja",$db);

$sql = "UPDATE anime set 
Anime_id='$Anime_id', 
Anime_name='$Anime_name', 
Ep_Start='$Ep_Start', 
EP_End='$EP_End',
Language ='$Language', 
Complete ='$Complete', 
Discs ='$Discs', 
Formats='$Formats',
Quality = '$Quality', 
Catergory ='$Catergory', 
Total_Ep='$Total_Ep', 
Year_made='$Year_made',
Date=now())
where Anime_id = $Anime_id"; 


$rs=mysql_query($sql,$db)or die("Cannot query the database.<br>" . mysql_error());

?>
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It's helpful if you post any error messages you receive.

Looks like you've got an extra closing parenthesis on this line:

Code: Select all

Date=now())
Mac
Post Reply