Previous Thread
Next Thread
Print Thread
Rate Thread
#262020 11/04/2003 11:36 AM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I used the change file method to upgrade because I have so many hacks and I ran the altertable for 6.3 to 6.4. At this point my forums will not display, here is the error I get on the top of the main site:

Code
 SQL ERROR: Tue, Nov 04 2003 08:32:37 -0800 Database error only visible to forum administrators <br /> <br />Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/vhfansco/public_html/boards/mysql.inc.php on line 133 <br /> <br />Warning: Cannot modify header information - headers already sent by (output started at /home/vhfansco/public_html/boards/mysql.inc.php:219) in <br />/home/vhfansco/public_html/boards/ubbt.inc.php on line 264 <br /> 

Sponsored Links
BlarC #262021 11/04/2003 11:46 AM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I would look in mysql error logs for a detail of the problem.

I would think offhand from my experience that it is related to the user table and the addition of the birthday field. You need to use phpmyadmin and check out the table. You can open up the altertable file and may have to manually add the user table query

ALTER TABLE w3t_Users
ADD U_Birthday VARCHAR(10) NOT NULL DEFAULT '0',
ADD U_ShowBday INT(1) NOT NULL DEFAULT '0',
ADD U_TimeFormat VARCHAR(6),
ADD U_Ignored TEXT,
ADD U_OC_Userid VARCHAR(64),
ADD INDEX birthday_ndx (U_Birthday,U_ShowBday)

Now if the above query does not run try running

ALTER TABLE w3t_Users
ADD U_ShowBday INT(1) NOT NULL DEFAULT '0',
ADD U_TimeFormat VARCHAR(6),
ADD U_Ignored TEXT,
ADD U_OC_Userid VARCHAR(64),
ADD INDEX birthday_ndx (U_Birthday,U_ShowBday)

At least thats what I remember when I upgraded a clean a few clean installs but all that had the birthday hack.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Neither of those worked. I suspected out of all the hacks I have installed that this wouldn't be a clean upgrade lol. Any other ideas?

BlarC #262023 11/04/2003 12:00 PM
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
update, even though I got errors with the command something took because the site is displaying properly now.

BlarC #262024 11/04/2003 12:03 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Glad it worked for you.

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Omegatron, I am not sure if this is causing my issue or not but when birthday's are entered they are not kept (I am also having this issue with avars, it only seems to be on my site) you can enter it fine but then when you go back it's gone.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
You would have to check your tables and check and see if they were formed.

Josh posted a birthday script to modify and update peoples birthdays to the new 6.4 on here

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Yes, if you were running the birthday mod - then the altertable will fail until you run my conversion script - because the U_Birthday field already exists.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Not sure which script that is, is it the bday cron script? https://www.ubbdev.com/forum/showflat...prev=#Post86334

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No - did you run the Birthday mod before?

If so you need this:
https://www.ubbdev.com/forum/showflat...art/3#Post96491

Sponsored Links
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Okay I ran this, also keep in mind that I did what Omegatron explained above. Nothing is working now, I can't explain all of it just jump in over there and try to look at posts or profiles. If need be I will shut down and pull out a backup, please let me know.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Here is what the error log reports. I went ahead and closed the boards until it's worked out.

Unable to do_query: SELECT t1.B_Number,t2.U_Username,t1.B_Posted,t1.B_IP,t1.B_Subject,t1.B_Body,t1.B_File,t1.B_Status,t1.B_Approved,t2.U_Picture,t1.B_Reged,t2.U_Title,t2.U_Color,t1.B_Icon,t1.B_Poll,t1.B_Parent,t2.U_Status,t2.U_Signature,t1.B_LastEdit,t1.B_LastEditBy,t2.U_Location,t2.U_TotalPosts,t2.U_Registered,t2.U_Rating,t2.U_Rates,t2.U_RealRating,t2.U_PicWidth,t2.U_PicHeight,t2.U_Number,t1.B_FileCounter,t1.B_AnonName,t1.B_ParentUser,t2.U_Birthday,t2.U_ShowBday,t1.B_AddSig,t2.U_Visible FROM w3t_Posts AS t1, w3t_Users AS t2 WHERE t1.B_Main = 16373 AND t1.B_PosterId = t2.U_Number AND B_Approved = 'yes' ORDER BY B_Number LIMIT 20 - Unknown column 't2.U_Birthday' in 'field list'

(sorry about the scroll)

Last edited by ericgtr; 11/10/2003 4:56 PM.
Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I am going to pull out a backup. This disclaimer in your post Josh (Backup your database first! I developed this for my own needs so use at your own risk. ) is not kidding

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
I found that his script added the birthday fields for the users but then made everything out of whack as it renames U_Birthday to U_BirthdayOLD and never made a NEW U_Birthday

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
It has this in it, doesn't this add it?
Code
 	ALTER TABLE {$config['tbprefix']}Users<br />	ADD   U_Birthday VARCHAR(10) NOT NULL DEFAULT '0',<br />	ADD   U_ShowBday INT(1) NOT NULL DEFAULT '0',<br />	ADD   U_TimeFormat VARCHAR(6),<br />	ADD   U_Ignored TEXT,<br />	ADD   U_OC_Userid VARCHAR(64),<br />	ADD   INDEX birthday_ndx (U_Birthday,U_ShowBday) 

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Yeah well when I ran mine it said database only available to admins LOL I was logged in as admin

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It should add it.

Were there any errors that it couldn't be run.

The problem is that we had a U_BirthDay field from the old mod - the the 6.4 altertable fails on the whole query when it tries to add a bunch of new stuff.

I can help you get it fixed - but right now I get "forbidden" errors.

If you've got PhpMyAdmin - PM me with access and I should be able to get you all fixed up.

I think that some fields didn't get properly added when you did the 6.4 upgrade.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Well just as an FYI Josh when I ran it on my test forum it converted the users and changed the field name to old but never created a new one.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
I wonder if the initial 6.4 altertable query did not fail for you - then mine just redoes that query - but some of the fields already existed, so the query failed.

In other words - it puzzled me that the altertable failed, although it doesn't on all servers. My Field was U_BirthDay - the new field is U_Birthday but on a Linux server, it says the field already exists. Not sure if different setups might not have had a problem with it.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Try this one - rename it .php and run it.

I split the creation of the new fields into separate queries, so if one of the fields already exists, it won't blow the whole thing.
Attachments
99328-convertbday.txt (0 Bytes, 30 downloads)

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks Josh but I went ahead and had Jeremy put last night's backup on. No problem, I was warned

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Is it fixed now?

Did the fields get added for 6.4?

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
It just got put back up by Jeremy (last nights backup) so I haven't tried it yet, I trust you though so if you say it's safe to run now I will go ahead and do it?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Do you want me to look?

You're a client of mine so you get primo service.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Sure.. have at it

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
OK _ just looked.

The U_Birthday field (new one) never got created, because you have U_BirthDay from my mod.

The other 6.4 fields are there.

My new script should work for you -

As it changes the old one - then goes through one by one and adds any fields that might have been missed. It'll fail on the ones that you've already got - but otherwise should be fine, because I split the queries out to add each field separately.... like this:

// Rename the old field
$query = "
ALTER TABLE {$config['tbprefix']}Users
CHANGE U_BirthDay U_BirthDayOLD INT( 2 ) UNSIGNED DEFAULT NULL
";
$sth = $dbh -> do_query($query);

echo "We need to create the new birthday fields - in case the 6.4 altertable couldn't do this at the time. You might get an error here too, which is OK.<br /><br />";
// Add the 6.4 fields in case the query to add them failed
$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Birthday VARCHAR(10) NOT NULL DEFAULT '0',
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_ShowBday INT(1) NOT NULL DEFAULT '0',
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_TimeFormat VARCHAR(6),
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Ignored TEXT,
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_OC_Userid VARCHAR(64),
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD INDEX birthday_ndx (U_Birthday,U_ShowBday)
";
$dbh -> do_query($query);



Give it a go and let me know.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
I just ran the new script (attached for refrence) and the site crashed again, do you mind checking it out Josh? Go to any post and you will see. Thanks.
Attachments
99337-convertbday.txt (0 Bytes, 36 downloads)

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Fixed - not sure why it didn't get created for you - fixed it. And will tweak and repost this script a bit.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
It did not create on my test site as well

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Thanks, so you added it as well? My original issue is still the same, it will not save the birthday settings. When you go into your profile and change it, it reverts back to Jan, 1 2003.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
You are still using the old changebasic.php - hasn't been updated since August.

Try uploading the one with 6.4 and that should do it.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
No error I can run the queries that Josh's script and they work. Now the problem is when I run the script as a script it renames the old table but never creates the new one.

Joined: May 2003
Posts: 1,068
Junior Member
Junior Member
Offline
Joined: May 2003
Posts: 1,068
Doh!! I knew it was something I missed I was also wondering how to tell what files I missed, great way.

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
Josh,

This is what I found with the script. I tried twice on linux.

The script will alter the old U_BirthDay field and rename it to old, However it will not create a new one. WEIRD

Anyway I went in by hand and made the field then was able to update the users to the new format.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Try this script.
Attachments
99350-convertbday.txt (0 Bytes, 40 downloads)

Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
If thats the one you posted a few posts back I tried that one as well.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No that one has never been posted.... the other one had som stray commas when I split the queries apart.

Daine #262057 11/10/2003 10:08 PM
Joined: Apr 2001
Posts: 3,266
Member
Member
Offline
Joined: Apr 2001
Posts: 3,266
This is what I was talking about

<?

require("main.inc.php");

echo "We need to rename the old field. You might get an error here, which is OK. <br /><br />";
// Rename the old field
$query = "
ALTER TABLE {$config['tbprefix']}Users
CHANGE U_BirthDay U_BirthDayOLD INT( 2 ) UNSIGNED DEFAULT NULL
";
$sth = $dbh -> do_query($query);

echo "We need to create the new birthday fields - in case the 6.4 altertable couldn't do this at the time. You might get an error here too, which is OK.<br /><br />";
// Add the 6.4 fields in case the query to add them failed
$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Birthday VARCHAR(10) NOT NULL DEFAULT '0'
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_ShowBday INT(1) NOT NULL DEFAULT '0'
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_TimeFormat VARCHAR(6)
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Ignored TEXT
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_OC_Userid VARCHAR(64)
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD INDEX birthday_ndx (U_Birthday,U_ShowBday)
";
$dbh -> do_query($query);

That sure looks the same as post 99336 which I tried.

No worries the last part works

All I was saying is every script you posted renamed the old one but does not create the new one.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
No the old one had commas after the ADD statements (as they all used to be in one big query) which would have caused errors.

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_ShowBday INT(1) NOT NULL DEFAULT '0',
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_TimeFormat VARCHAR(6),
";
$dbh -> do_query($query);

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Ignored TEXT,

See the errors at the end of the ADD lines with nothing after them? Those caused SQL errors.

So with the latest script -
When it runs this query:

$query = "
ALTER TABLE {$config['tbprefix']}Users
ADD U_Birthday VARCHAR(10) NOT NULL DEFAULT '0'
";
$dbh -> do_query($query);



What SQL error do you get - either has to create or give you an error.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
AllenAyres
AllenAyres
Texas
Posts: 21,079
Joined: March 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)