Author Topic: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...  (Read 6735 times)

0 Members and 1 Guest are viewing this topic.

Offline Xandra

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • D-zynez Graphics
DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« on: November 05, 2005, 11:56:21 AM »
I am aware that patched 4images will not be supported, but I am just needing at least a direction where to look for the problem. I integrated 4images 1.7.1 with Xoops portal.

I was trying to edit a user in the 4images control panel and I get this DB error:

DB Error: Bad SQL Query: UPDATE xoops_users SET level = 1, uname = 'lyzz', email = 'lyzzandra74@yahoo.com', user_viewemail = 0, user_mailok = 1, user_regdate = UNIX_TIMESTAMP('2005-08-04 09:27'), = UNIX_TIMESTAMP('1969-12-31 16:00'), url = '', user_icq = '', user_dl_limit = '40', user_dl_time = '0', user_dl_count = '0' WHERE uid = 4

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= UNIX_TIMESTAMP('1969-12-31 16:00'), url = '', user_icq = '', user_dl_limit = '' at line 2
Error editing user


--

I tried editing the download limit - I got the above error
I tried editing the "Last Activity" to an actual date (it seems by default it is with year 1969) - I got similar error message
I concluded that this has nothing to do with the download limit at all but somewhere in editing a user.

It says on that message to check for the right syntax to use? Could anyone pls point out to me where and how I could fix that?

--
Not sure if the ff. info would help:
SERVER_SOFTWARE  Apache/1.3.33 (Unix) DAV/1.0.3 mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a PHP/4.3.10 mod_ssl/2.8.22 OpenSSL/0.9.7e 
MySQL client 4.1.11

TYVM in advance.

Xandra

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #1 on: November 05, 2005, 12:03:10 PM »
user_regdate = UNIX_TIMESTAMP('2005-08-04 09:27'), XXXXX = UNIX_TIMESTAMP('1969-12-31 16:00'),

here is the problem

Offline Xandra

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • D-zynez Graphics
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #2 on: November 05, 2005, 12:19:58 PM »
Acidgod: thank you so much for the prompt reply.. now hehe, where can I fix that? Sorry, if I sound dumb, but I prefer to know what I am doing.

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #3 on: November 05, 2005, 12:22:38 PM »
for what do you need this "= UNIX_TIMESTAMP('1969-12-31 16:00')"?

Offline Xandra

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • D-zynez Graphics
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #4 on: November 05, 2005, 12:30:25 PM »
that refers to the field: Last Activity
(when you go and edit a user in the 4images ACP, you see that field after "Date of Registration")

Offline Acidgod

  • Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #5 on: November 05, 2005, 12:54:51 PM »
can you show me the Part with the Query?

Offline Xandra

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • D-zynez Graphics
Re: DB error: ..right syntax to use near '= UNIX_TIMESTAMP...
« Reply #6 on: November 05, 2005, 01:16:57 PM »
lol, I just discovered the problem now. After so many testings, I got it right. xoops uses a different variable and the "patcher" just left that field blank in the sessions.php

NOTE: I am using Koudanshi's patch - a good starting (only!) step to integrate xoops and 4images. But it is not a flawless patch - I had to fix several db errors plus if you want to use some 4images mods - a good comprehension in php is the most ideal. I basically know nothing if I were to do a php page lol.

TY so much for your help, Acid!