News:

Join the Facebook Fan Page.

Main Menu

phpnuke

Started by armdoggy, May 13, 2005, 05:47:44 PM

Previous topic - Next topic

Silver-SAF

Ahh right, sorry I missed that.

Anyway, did that, all is good.

Except when I try to go on the Manage Boards option in the Admin panel i get this error

QuoteUnknown column 'b.topicSolved' in 'field list'
File: e:\domains\g\gtacomplex.co.uk\user\htdocs\smf\Sources\ManageBoards.php
Line: 852

Silver-SAF

I upgraded and it works fine now.

Currently running V 1.0.5

Chelle

I need some help with a statement.  I figured my reg dates wouldn't convert over, so I wasn't too concerned.  I figured I could just run a statement like I did with the user groups, but I'm afraid I only know of MySQL what i've picked up over the years.  I get stuck on the part to update my _members table.

SELECT user_id, user_regdate AS dateRegistered FROM prefix_users LIMIT 0 , 30
UPDATE smfPrefix_members SET dateRegistered = user_regdate WHERE ID_MEMBER=user_id


It's a syntax error.  Annoying cause I know what pieces of info I need selected, I just can't figure out how to tell it what I want to do with it.

In case it's not obvious from the obvious, wanted it to take the user_id and user_regdate and then seek the same user_id as it occurs in ID_MEMBER and update the dateRegistered with the data from user_regdate.

Any suggestions for other things to try since there's prolly other ways to tackle this?  I'm trying it on a smaller board with test data before I use it on a bigger board, so no worries about things getting botched.
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

[Unknown]

UPDATE smf_members AS mem, phpbb_users AS u
SET mem.dateRegistered = u.user_regdate
WHERE mem.ID_MEMBER = u.user_id;

This will only work in MySQL 4 and above.  But, why wasn't this converted properly automatically?

-[Unknown]

Chelle

I don't know, but I suspect a difference in how the data is stored..it doesn't convert properly.  user_regdate is a  varchar(20) versus a  int(10) unsigned for the smf table.  After running the convert.php tt will have a value of 0 in the database and when you look at the members list, all of them are  1969-12-31 as the reg date and the same result occurs when running the corrected statement you provided.
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

Silver-SAF

My Reg Dates didnt get carried over but I am not to bothered about that.

I just hope all the users who register in nuke get added to the DB.

[Unknown]

Then try:

UPDATE smf_members AS mem, phpbb_users AS u
SET mem.dateRegistered = UNIX_TIMESTAMP(u.user_regdate)
WHERE mem.ID_MEMBER = u.user_id;

-[Unknown]

Silver-SAF

Do you mean as a SQL Query in phpMyadmin ??

[Unknown]


Silver-SAF

Okie dokie, just checking so I didn't screw things up .

Silver-SAF

I guess that was to update my members registration dates?

If so, i must have done something wrong as it did not work.

QuoteSQL-query:
UPDATE smf_members AS mem,
nuke_users AS u SET mem.dateRegistered = UNIX_TIMESTAMP( u.user_regdate ) WHERE mem.ID_MEMBER = u.user_id

[Unknown]

Did it give an error message or just do nothing?

-[Unknown]

Chelle

No error given, it didn't change anything; the date is still 0 in the smf_members table in the database. 
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

[Unknown]

Quote from: Chelle on August 21, 2005, 07:17:39 PM
No error given, it didn't change anything; the date is still 0 in the smf_members table in the database. 

Then what's stored in the varchar?  Can you give a specific example of a date?

Date registered is stored as seconds since 1969, in SMF.

-[Unknown]

Silver-SAF

Well if you mean what format it is.

May 28, 2004

Is that what you mean, also I had no error.

Chelle

Just wanted to elaborate on the result given..I just realized this today, when running that statement, the result yeilds this:

Affected rows: 0 (Query took 0.0263 sec)
SQL-query:
UPDATE smf_members AS mem,
phpbb_users AS u SET mem.dateRegistered = UNIX_TIMESTAMP( u.user_regdate ) WHERE mem.ID_MEMBER = u.user_id
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

Chelle

Also, I asked over at nukecops how the user's regdate gets stored, cause I figure that'd be helpful too:

QuoteIn modules/Your_Account/index.php in the finishNewUser function

$user_regdate = date("M d, Y");

Then it is inserted into nuke_users_temp by the following query:
$result = $db->sql_query("INSERT INTO ".$user_prefix."_users_temp (user_id, username, user_email, user_password, user_regdate, check_num, time) VALUES (NULL, '$username', '$user_email', '$new_password', '$user_regdate', '$check_num', '$time')");

Sorry I can't be more helpful..MySQL has a big learning curve for me still
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

[Unknown]

Bleh.  That's no fun.

Change this:

UNIX_TIMESTAMP(u.user_regdate) AS dateRegistered

Back to this:

u.user_regdate AS dateRegistered

Then change this:

unset($row['signature_uid']);
---}


To this:

unset($row['signature_uid']);

$row['dateRegistered'] = strtotime($row['dateRegistered']);
---}


Or in other words, the attached file.

-[Unknown]

Chelle

w00t!  That did it.  Thanks [Unknown], you rock.  This is not news.
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

Chelle

Ok, next question,  can strtotime be used in a statement?  Because I can't run the converter on the other board I have without loosing info.  So would I need to select dateRegistered, do the equivalent of  $row['dateRegistered'] = strtotime($row['dateRegistered']); then run

UPDATE smf_members AS mem,
phpbb_users AS u
SET mem.dateRegistered =  u.user_regdate
WHERE mem.ID_MEMBER = u.user_id

umm, right? And if yes, I've tried some things, but my syntax isn't right in trying to get the equivalent of he equivalent of  $row['dateRegistered'] = strtotime($row['dateRegistered']);
Disclaimer: The above post may contain elements of cheekiness.

My eccentricity has nothing to do with my stabilization

Advertisement: