DB update failed

From TNG_Wiki
Jump to navigation Jump to search

User Question

Qustion 1: When I ran the db7x-8x.php, I got the following message. Can someone tell me if the database appears to have updated correctly?

\n"; $rval = true; } else { echo "failed or done previously \n"; $rval = false; } return $rval; } ?> TNG 8.x Database Structure Update failed."); while( $row = mysql_fetch_assoc($dresult)) { $uallow_add = $row['allow_add']; $uallow_edit = $row['allow_edit']; $uallow_delete = $row['allow_delete']; $utent_edit = $row['tentative_edit']; $utree = $row['gedcom']; $role = "custom"; if($uallow_add) { if($uallow_edit) { if($uallow_add == "1" && $uallow_edit == "1" && $uallow_delete == "1") $role = $utree ? "editor" : "admin"; } elseif(!$uallow_delete) { $role = "contrib"; } } elseif($utent_edit) { if(!$uallow_delete) $role = "subm"; } else { if(!$uallow_edit && !$uallow_delete) $role = "guest"; } $query = "UPDATE $users_table SET role=\"$role\" WHERE userID=\"{$row['userID']}\""; $result = mysql_query($query) or die ("failed"); } mysql_free_result($dresult); echo "done"; ?> The Next Generation database has now been updated to v8.x specs.

NOTE: Because this upgrade is compatible with several incremental versions, there may be some commands that have already been done, so don't be alarmed if some lines say "failed or done previously".

Question 2: Here is the real problem. I'm not getting to the database. For example, here is the message I get when I look at the "Statistics". Can anyone give me an idea of what is going wrong.

Cannot execute query: SELECT personID, firstname, lnprefix, lastname, birthdate, gedcom, living, private, branch FROM tng_people WHERE birthdatetr != '0000-00-00' ORDER BY birthdatetr LIMIT 1

Darrin's Answer

Your second problem is because of your first problem, and your first problem is that you haven't really run the upgrade_db7x-8x.php script if that's the output you're getting from it.

Basically you're seeing what you'd see if you loaded the page as an HTML document, which makes me wonder if you're still looking at the readme7x-810.html file on your local computer.

One of the first steps of the upgrade is to upload the readme file, then close the local copy you were looking at and open it again from your web site (ie, go to http://www.mywebsite.com/readme7x-810.html).

Make sure you're looking at that copy before you try to click on the

upgrade_db7x-8x.php link.