You are here: Re: Problem with NOW() with PHP and MySQL « All PHP « IT news, forums, messages
Re: Problem with NOW() with PHP and MySQL

Posted by Seansan on 03/29/07 19:46

Tom wrote:
> On Wed, 28 Mar 2007 18:17:19 +0200, Seansan wrote...
>> Anybody have an idea why (and I have been trying for 1 hour now) when I
>> execute this code that last_change is never update, but all the other
>> fields are?
>>
>> I just have no idea!
>>
>> $DB->query("UPDATE ".get_table_name('users')."
>> SET last_login=NOW(), last_change=NOW(),
>> session=?
>> WHERE user_id=?",
>> true, $_SESSION['user_id']);
>
> Maybe try building your statement as a variable, them print it out to make sure
> the syntax is correct.
>
> $cmd = ("UPDATE ".get_table_name('users')."
> SET last_login=NOW(), last_change=NOW(),
> session=?
> WHERE user_id=?";
>
> echo($cmd);
>
> $DB->query($cmd,true, $_SESSION['user_id']);
>
>
> Might also try using "mysql_error()" to see if that returns a specific error.
>
> Tom
> --
> Newsguy.com
> Express Accounts - 30 GB $9.95 / month
>

First of al thank you for your answers.

I just changed the table column to another name (now temporaily called
TEMP). Now it does update!!!

It seems like "last_change" is some kind of protected name/variable.....
or I dont know. BTW I use PEAR DB class.

I dont know what exactly is causing this, but I am resolving for now by
renaming the column so it will update.

Seansan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация