Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update date time database failed

Status
Not open for further replies.

ljCharlie

IS-IT--Management
Apr 21, 2003
397
0
0
US
I couldn't update from my .php page to MySQL database. Here's my code:

$query = "UPDATE activities SET actID = '$dateID', ljDate = '$mysqlDate', What = '$txtWhat', ljTime = '$txtTime', Location = '$txtLocation', Who = '$txtWho' WHERE actID == $dateID";
$result = mysql_query($query);
if(!$result) {
echo "Error: Can not update the database. Please try again later.";
exit;
}

actID is varchar
ljDate is Date
What is varchar
ljTime is Time
Location is varchar
Who is varchar

The $mysqlDate variable is in YYYY-MM-DD and $txtTime is in HH:MM:SS so please help if anyone have any idea.

Many thanks in advance!

ljCharlie
 
Maybe you should set the $dateID-Variable in the WHERe-Clause also in quotes.

Thomas
 
Thanks for trying to help. I got it working now. Actually the $dateID has to be in quote and instead of using == it should only be one equal sign.

ljCharlie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top