1
ossi
MYSQL - XOOPS_groups_users_link
  • 2004/5/24 13:33

  • ossi

  • Just popping in

  • Posts: 39

  • Since: 2002/9/9 1


updated XOOPS 1.3.8 to 2.0.6 worked ok just a couple of issues. The most important to resolve right now is the following.

All +8.000 user accounts are converted ok.
Users get logged in but get redirected to there useraccount page and are not allowed to see anything else.

Reason:
The TABLE XOOPS_groups_users_link
is not populated....
How can i populate this table with all the
uid´s from the XOOPS_users table and automaticly have all that are created in this table to be assigned to
groupid 2

must be a walk in the park 4 u guys or

2
Mithrandir
Re: MYSQL - XOOPS_groups_users_link

<?php
include mainfile.php;
$failed 0;
$sql "SELECT uid FROM ".$xoopsDB->prefix('users');
$result $xoopsDB->query($sql);
while (list(
$uid) = $xoopsDB->fetchRow($result)) {
     if (!
$xoopsDB->query("INSERT INTO ".$xoopsDB->prefix('groups_users_link')." (groupid, uid) VALUES (2, $uid)")) {
         
$failed++;
     }
}
echo 
$failed." inserts failed";
?>


Try popping that in a php file and drop it in the XOOPS root and run it.

Hope it works for you.

3
ossi
Re: MYSQL - XOOPS_groups_users_link
  • 2004/5/24 14:05

  • ossi

  • Just popping in

  • Posts: 39

  • Since: 2002/9/9 1


I get:

Warning: main(mainfilephp): failed to open stream: No such file or directory in

Warning: main(): Failed opening 'mainfilephp' for inclusion (include_path='.:/usr/local/lib/php')


and the famous...

Fatal error: Call to a member function on a non-object in

so that was a no´go....

a SQL statement would probably be better than a script "I guess" ...

4
Herko
Re: MYSQL - XOOPS_groups_users_link
  • 2004/5/24 14:06

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


mainfile.php Mind the dot, and make sure you run the php file in the same folder as the system's mainfile.php.

Herko

5
Dave_L
Re: MYSQL - XOOPS_groups_users_link
  • 2004/5/24 14:16

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


The filename needs to be quoted. And I would use "require" instead of "include", to force a fatal error if the inclusion fails.

require 'mainfile.php';

Login

Who's Online

180 user(s) are online (115 user(s) are browsing Support Forums)


Members: 0


Guests: 180


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits