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 />
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.
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.
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.
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.
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'
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
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
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.
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.
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?
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);
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.
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.
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.
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);
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.